/*
 * 파일명: tools.css
 * 파일경로: /home/ocimaster/web/urly.kr/public_html/assets/css/
 * 기능: 웹툴 허브 및 개별 웹툴 전용 스타일
 * 작성일: 2026-05-05
 *
 * 작성 기준:
 * - 프로젝트 공통 CSS 변수 우선 사용
 * - 웹툴 전용 클래스는 tool-, word- 접두어 사용
 * - 과도한 font-weight 지양
 * - 모바일 퍼스트 보완
 */

/* ==========================================================================
   Tools Tokens
   ========================================================================== */

:root {
  --tool-primary: var(--color-primary, #18609C);
  --tool-primary-hover: var(--color-primary-hover, #124d7e);
  --tool-bg: var(--color-bg, #f8fafc);
  --tool-surface: var(--color-surface, #ffffff);
  --tool-muted: var(--color-muted, #eef2f7);
  --tool-text: var(--color-text, #1a1a1a);
  --tool-text-sub: var(--color-text-sub, #666666);
  --tool-text-muted: var(--color-text-muted, #9096A8);
  --tool-border: var(--color-border, #e0e6ed);

  --tool-radius-sm: var(--radius-sm, 6px);
  --tool-radius-md: var(--radius-md, 10px);
  --tool-radius-lg: var(--radius-lg, 16px);
  --tool-shadow-sm: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, .06));
  --tool-shadow-md: var(--shadow-md, 0 6px 24px rgba(0, 0, 0, .09));

  --tool-space-1: var(--space-1, 4px);
  --tool-space-2: var(--space-2, 8px);
  --tool-space-3: var(--space-3, 12px);
  --tool-space-4: var(--space-4, 16px);
  --tool-space-5: var(--space-5, 24px);
  --tool-space-6: var(--space-6, 32px);
  --tool-space-7: var(--space-7, 48px);

  --tool-fs-xs: var(--fs-xs, 12px);
  --tool-fs-sm: var(--fs-sm, 13px);
  --tool-fs-base: var(--fs-base, 14px);
  --tool-fs-md: var(--fs-md, 16px);
  --tool-fs-lg: var(--fs-lg, 20px);
  --tool-fs-xl: var(--fs-xl, 28px);
}

/* ==========================================================================
   Shared Layout
   ========================================================================== */

.tool-wrap {
  padding: var(--tool-space-4) 0 var(--tool-space-7);
}

.tool-section {
  margin-top: var(--tool-space-6);
}

.tool-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--tool-space-4);
  margin-bottom: var(--tool-space-4);
}

.tool-section-title {
  margin: 0;
  color: var(--tool-text);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.tool-section-desc {
  margin: var(--tool-space-2) 0 0;
  color: var(--tool-text-sub);
  font-size: var(--tool-fs-md);
  line-height: 1.65;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.tool-hero {
  position: relative;
  overflow: hidden;
  padding: var(--tool-space-7) var(--tool-space-6);
  border: 1px solid var(--tool-border);
  border-radius: var(--tool-radius-lg);
  background:
    radial-gradient(circle at top right, rgba(24, 96, 156, 0.12), transparent 34%),
    linear-gradient(135deg, #f7fbff 0%, var(--tool-surface) 58%, #f2f7fb 100%);
  box-shadow: var(--tool-shadow-sm);
}

.tool-hero-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 var(--tool-space-3);
  border-radius: 999px;
  background: rgba(24, 96, 156, 0.08);
  color: var(--tool-primary);
  font-size: var(--tool-fs-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.tool-hero-title {
  margin: var(--tool-space-4) 0 0;
  color: var(--tool-text);
  font-size: clamp(30px, 4.2vw, 44px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.16;
}

.tool-hero-desc {
  max-width: 760px;
  margin: var(--tool-space-4) 0 0;
  color: var(--tool-text-sub);
  font-size: var(--tool-fs-md);
  line-height: 1.75;
}

.tool-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tool-space-2);
  margin-top: var(--tool-space-5);
}

.tool-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tool-space-2);
  margin-top: var(--tool-space-5);
}

.tool-chip-row span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 var(--tool-space-3);
  border: 1px solid var(--tool-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--tool-text-sub);
  font-size: var(--tool-fs-base);
  font-weight: 500;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.tool-primary-btn,
.tool-secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--tool-radius-md);
  font-size: var(--tool-fs-base);
  font-family: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}

.tool-primary-btn {
  border: 1px solid var(--tool-primary);
  background: var(--tool-primary);
  color: #fff;
}

.tool-primary-btn:hover {
  background: var(--tool-primary-hover);
  border-color: var(--tool-primary-hover);
  text-decoration: none;
}

.tool-secondary-btn {
  border: 1px solid var(--tool-border);
  background: var(--tool-surface);
  color: var(--tool-primary);
}

.tool-secondary-btn:hover {
  border-color: var(--tool-primary);
  text-decoration: none;
}

.tool-primary-btn:hover,
.tool-secondary-btn:hover {
  transform: translateY(-1px);
}

.tool-secondary-btn.is-small {
  min-height: 36px;
  padding: 0 var(--tool-space-3);
  border-radius: var(--tool-radius-md);
  font-size: var(--tool-fs-sm);
}

/* ==========================================================================
   Cards
   ========================================================================== */

.tool-card,
.tool-category-card,
.tool-mini-card,
.tool-info-card,
.word-input-card,
.word-stat-card,
.word-progress-card,
.tool-related-card,
.tool-step-item,
.tool-faq-list {
  border: 1px solid var(--tool-border);
  background: var(--tool-surface);
  box-shadow: var(--tool-shadow-sm);
}

.tool-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--tool-space-4);
}

.tool-card {
  display: flex;
  flex-direction: column;
  min-height: 210px;
  padding: var(--tool-space-5);
  border-radius: var(--tool-radius-lg);
  color: inherit;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--tool-primary);
  box-shadow: var(--tool-shadow-md);
  text-decoration: none;
}

.tool-card-top,
.tool-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--tool-space-2);
}

.tool-card-category {
  color: var(--tool-primary);
  font-size: var(--tool-fs-sm);
  font-weight: 700;
}

.tool-card-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 var(--tool-space-3);
  border-radius: 999px;
  background: rgba(24, 96, 156, 0.08);
  color: var(--tool-primary);
  font-size: var(--tool-fs-xs);
  font-weight: 700;
}

.tool-card h3 {
  margin: var(--tool-space-5) 0 0;
  color: var(--tool-text);
  font-size: var(--tool-fs-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tool-card p {
  flex: 1;
  margin: var(--tool-space-2) 0 var(--tool-space-4);
  color: var(--tool-text-sub);
  font-size: var(--tool-fs-base);
  line-height: 1.7;
}

.tool-card-foot {
  color: var(--tool-primary);
  font-size: var(--tool-fs-base);
  font-weight: 500;
}

/* ==========================================================================
   Category / Mini Cards
   ========================================================================== */

.tool-category-grid,
.tool-mini-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--tool-space-3);
}

.tool-category-card,
.tool-mini-card {
  padding: var(--tool-space-4);
  border-radius: var(--tool-radius-lg);
}

.tool-mini-card {
  background: #fbfdff;
}

.tool-category-card h3,
.tool-mini-card h3 {
  margin: 0;
  color: var(--tool-text);
  font-size: var(--tool-fs-md);
  font-weight: 700;
  line-height: 1.4;
}

.tool-category-card p,
.tool-mini-card p {
  margin: var(--tool-space-2) 0 0;
  color: var(--tool-text-sub);
  font-size: var(--tool-fs-base);
  line-height: 1.65;
}

.tool-mini-card span {
  display: inline-block;
  margin-bottom: var(--tool-space-2);
  color: var(--tool-primary);
  font-size: var(--tool-fs-xs);
  font-weight: 700;
}

/* ==========================================================================
   Info / Feature / FAQ
   ========================================================================== */

.tool-info-card {
  padding: var(--tool-space-5);
  border-radius: var(--tool-radius-lg);
  background:
    linear-gradient(135deg, rgba(24, 96, 156, 0.06), rgba(255, 255, 255, 0.96));
}

.tool-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--tool-space-3);
  margin-top: var(--tool-space-4);
}

.tool-feature-grid div {
  padding: var(--tool-space-4);
  border-radius: var(--tool-radius-lg);
  background: rgba(255, 255, 255, 0.78);
}

.tool-feature-grid strong {
  display: block;
  color: var(--tool-text);
  font-size: var(--tool-fs-md);
  font-weight: 700;
}

.tool-feature-grid p {
  margin: var(--tool-space-2) 0 0;
  color: var(--tool-text-sub);
  font-size: var(--tool-fs-base);
  line-height: 1.6;
}

.tool-definition-desc {
  margin: var(--tool-space-3) 0 0;
  color: var(--tool-text-sub);
  font-size: var(--tool-fs-md);
  line-height: 1.8;
}

.tool-faq-list {
  margin-top: var(--tool-space-3);
  border-radius: var(--tool-radius-lg);
  overflow: hidden;
}

.tool-faq-item {
  padding: 0 var(--tool-space-4);
  border-top: 1px solid var(--tool-border);
}

.tool-faq-item:first-child {
  border-top: 0;
}

.tool-faq-item summary {
  cursor: pointer;
  padding: var(--tool-space-4) 0;
  color: var(--tool-text);
  font-size: var(--tool-fs-base);
  font-weight: 500;
  line-height: 1.5;
}

.tool-faq-answer {
  padding: 0 0 var(--tool-space-4);
  color: var(--tool-text-sub);
  font-size: var(--tool-fs-base);
  line-height: 1.75;
}

/* ==========================================================================
   Word Counter
   ========================================================================== */

.word-counter-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .85fr);
  gap: var(--tool-space-4);
  align-items: stretch;
}

.word-input-card {
  padding: var(--tool-space-5);
  border-radius: var(--tool-radius-lg);
}

.word-input-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--tool-space-3);
  margin-bottom: var(--tool-space-3);
}

.word-input-head h2 {
  margin: 0;
  color: var(--tool-text);
  font-size: var(--tool-fs-lg);
  font-weight: 700;
}

.word-input-head p {
  margin: var(--tool-space-2) 0 0;
  color: var(--tool-text-sub);
  font-size: var(--tool-fs-base);
  line-height: 1.55;
}

.word-input-actions {
  display: flex;
  gap: var(--tool-space-2);
  flex-shrink: 0;
}

.word-textarea {
  width: 100%;
  min-height: 360px;
  padding: var(--tool-space-4);
  border: 1px solid var(--tool-border);
  border-radius: var(--tool-radius-lg);
  outline: none;
  resize: vertical;
  color: var(--tool-text);
  background: #fbfdff;
  font-family: inherit;
  font-size: var(--tool-fs-md);
  line-height: 1.75;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.word-textarea:focus {
  border-color: var(--tool-primary);
  background: var(--tool-surface);
  box-shadow: 0 0 0 3px rgba(24, 96, 156, 0.08);
}

.word-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--tool-space-3);
}

.word-stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 112px;
  padding: var(--tool-space-4);
  border-radius: var(--tool-radius-lg);
}

.word-stat-card span {
  color: var(--tool-text-sub);
  font-size: var(--tool-fs-sm);
  font-weight: 500;
}

.word-stat-card strong {
  margin-top: var(--tool-space-2);
  color: var(--tool-primary);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  word-break: break-all;
}

.word-stat-card em {
  margin-top: var(--tool-space-1);
  color: var(--tool-text-muted);
  font-size: var(--tool-fs-xs);
  font-style: normal;
  font-weight: 500;
}

.word-progress-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--tool-space-3);
}

.word-progress-card {
  padding: var(--tool-space-4);
  border-radius: var(--tool-radius-lg);
}

.word-progress-head {
  display: flex;
  justify-content: space-between;
  gap: var(--tool-space-2);
  margin-bottom: var(--tool-space-3);
}

.word-progress-head strong {
  color: var(--tool-text);
  font-size: var(--tool-fs-base);
  font-weight: 500;
  line-height: 1.4;
}

.word-progress-head span {
  color: var(--tool-primary);
  font-size: var(--tool-fs-sm);
  font-weight: 700;
  white-space: nowrap;
}

.word-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(24, 96, 156, 0.1);
  overflow: hidden;
}

.word-progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--tool-primary);
  transition: width .15s;
}

/* ==========================================================================
   Steps / Related
   ========================================================================== */

.tool-step-list {
  display: grid;
  gap: var(--tool-space-3);
  margin-top: var(--tool-space-3);
}

.tool-step-item {
  display: flex;
  gap: var(--tool-space-3);
  padding: var(--tool-space-4);
  border-radius: var(--tool-radius-lg);
}

.tool-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--tool-primary);
  color: #fff;
  font-size: var(--tool-fs-base);
  font-weight: 700;
  flex-shrink: 0;
}

.tool-step-item h3 {
  margin: 0;
  color: var(--tool-text);
  font-size: var(--tool-fs-md);
  font-weight: 500;
}

.tool-step-item p {
  margin: var(--tool-space-2) 0 0;
  color: var(--tool-text-sub);
  font-size: var(--tool-fs-base);
  line-height: 1.65;
}

.tool-related-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--tool-space-4);
  padding: var(--tool-space-5);
  border-radius: var(--tool-radius-lg);
}

.tool-related-card h2 {
  margin: 0;
  color: var(--tool-text);
  font-size: var(--tool-fs-lg);
  font-weight: 700;
}

.tool-related-card p {
  margin: var(--tool-space-2) 0 0;
  color: var(--tool-text-sub);
  font-size: var(--tool-fs-base);
  line-height: 1.65;
}

/* ==========================================================================
   Responsive
   기준:
   - 1100px 이하: 태블릿/작은 데스크톱
   - 820px 이하: 모바일/태블릿 세로
   - 440px 이하: 작은 모바일
   ========================================================================== */

@media (max-width: 1100px) {
  .tool-category-grid,
  .tool-mini-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .word-counter-panel {
    grid-template-columns: 1fr;
  }

  .word-progress-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .tool-wrap {
    padding: var(--tool-space-3) 0 var(--tool-space-6);
  }

  .tool-hero {
    padding: var(--tool-space-6) var(--tool-space-4);
  }

  .tool-hero-actions {
    flex-direction: column;
  }

  .tool-primary-btn,
  .tool-secondary-btn {
    width: 100%;
  }

  .tool-chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: var(--tool-space-1);
  }

  .tool-chip-row span {
    flex: 0 0 auto;
  }

  .tool-card-grid,
  .tool-category-grid,
  .tool-mini-grid,
  .tool-feature-grid,
  .word-progress-grid {
    grid-template-columns: 1fr;
  }

  .tool-card {
    min-height: auto;
  }

  .word-input-head {
    flex-direction: column;
  }

  .word-input-actions {
    width: 100%;
  }

  .word-input-actions .tool-secondary-btn {
    flex: 1;
  }

  .word-textarea {
    min-height: 280px;
  }

  .word-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .word-stat-card {
    min-height: 104px;
  }

  .tool-related-card {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 440px) {
  .tool-hero,
  .word-input-card,
  .tool-info-card,
  .tool-related-card {
    padding: var(--tool-space-4);
  }

  .word-stat-grid {
    gap: var(--tool-space-2);
  }

  .word-stat-card {
    padding: var(--tool-space-3);
  }

  .tool-faq-item {
    padding: 0 var(--tool-space-3);
  }
}

/* ==========================================================================
   URL Encoder Tool
   ========================================================================== */

.url-tool-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.url-input-card,
.url-result-card {
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 18px;
  background: #fff;
  padding: 22px;
}

.url-textarea {
  min-height: 180px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  word-break: break-all;
}

.url-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.url-mode-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-height: 100%;
  padding: 14px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 14px;
  background: #f8fafc;
  cursor: pointer;
}

.url-mode-card input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--clr-primary, #18609C);
}

.url-mode-card strong {
  display: block;
  color: var(--clr-text, #111827);
  font-size: 14px;
  line-height: 1.4;
}

.url-mode-card em {
  display: block;
  margin-top: 4px;
  color: var(--clr-text-muted, #6b7280);
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
}

.url-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.url-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

#urlResultStatus.is-error {
  color: #b42318;
}

.tool-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 16px;
  background: #fff;
}

.tool-compare-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.tool-compare-table th,
.tool-compare-table td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--clr-border, #e5e7eb);
  color: var(--clr-text, #111827);
  font-size: 14px;
  line-height: 1.6;
  text-align: left;
  vertical-align: top;
}

.tool-compare-table thead th {
  background: #f8fafc;
  font-weight: 700;
}

.tool-compare-table tbody tr:last-child th,
.tool-compare-table tbody tr:last-child td {
  border-bottom: 0;
}

.tool-mobile-compare {
  display: none;
}

@media (max-width: 820px) {
  .url-input-card,
  .url-result-card {
    padding: 18px;
  }

  .url-mode-grid,
  .url-stat-grid {
    grid-template-columns: 1fr;
  }

  .url-action-row .tool-primary-btn,
  .url-action-row .tool-secondary-btn {
    width: 100%;
    justify-content: center;
  }

  .tool-table-scroll {
    display: none;
  }

  .tool-mobile-compare {
    display: grid;
    gap: 12px;
  }

  .tool-compare-card {
    border: 1px solid var(--clr-border, #e5e7eb);
    border-radius: 14px;
    background: #fff;
    padding: 15px;
  }

  .tool-compare-card strong {
    display: block;
    margin-bottom: 6px;
    color: var(--clr-text, #111827);
    font-size: 14px;
  }

  .tool-compare-card p {
    margin: 0;
    color: var(--clr-text-muted, #6b7280);
    font-size: 13px;
    line-height: 1.6;
  }
}



/* ========================================================================
   UTM URL Builder Tool
   파일: /assets/css/tools.css 맨 아래 추가
   ======================================================================== */

.utm-builder-page .utm-tool-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 24px;
  align-items: start;
}

.utm-input-card,
.utm-result-card {
  padding: 24px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 18px;
  background: #fff;
}

.utm-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.utm-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.utm-field.is-wide {
  grid-column: 1 / -1;
}

.utm-field span {
  color: var(--clr-text, #111827);
  font-size: 14px;
  font-weight: 700;
}

.utm-field span em {
  margin-left: 4px;
  color: var(--clr-primary, #18609c);
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
}

.utm-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 12px;
  color: var(--clr-text, #111827);
  font: inherit;
  font-size: 15px;
  outline: none;
}

.utm-field input:focus {
  border-color: var(--clr-primary, #18609c);
  box-shadow: 0 0 0 3px rgba(24, 96, 156, 0.12);
}

.utm-preset-block {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 14px;
  background: var(--clr-surface, #f8fafc);
}

.utm-preset-block > strong {
  display: block;
  margin-bottom: 10px;
  color: var(--clr-text, #111827);
  font-size: 14px;
}

.utm-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.utm-result-textarea {
  min-height: 180px;
  margin-top: 18px;
  word-break: break-all;
}

.utm-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

#utmResultStatus.is-error {
  color: #b42318;
}

@media (max-width: 900px) {
  .utm-builder-page .utm-tool-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .utm-form-grid {
    grid-template-columns: 1fr;
  }

  .utm-input-card,
  .utm-result-card {
    padding: 18px;
    border-radius: 16px;
  }
}



/* ========================================================================== 
   Password Generator Tool (/tools/password-generator)
   ========================================================================== */
.password-tool-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  gap: 22px;
  align-items: start;
}

.password-option-card,
.password-result-card {
  background: #fff;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}

.password-length-box {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 14px;
  background: #f8fafc;
}

.password-length-head,
.password-range-note,
.password-strength-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.password-length-head label,
.password-strength-head strong {
  font-weight: 700;
  color: var(--clr-text, #111827);
}

.password-length-head strong {
  color: var(--clr-primary, #18609C);
}

.password-length-box input[type="range"] {
  width: 100%;
  margin: 16px 0 8px;
  accent-color: var(--clr-primary, #18609C);
}

.password-range-note {
  font-size: 12px;
  color: var(--clr-text-muted, #64748b);
}

.password-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.password-check-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}

.password-check-card input {
  margin-top: 3px;
  accent-color: var(--clr-primary, #18609C);
}

.password-check-card strong {
  display: block;
  font-size: 14px;
  color: var(--clr-text, #111827);
}

.password-check-card em {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-size: 12px;
  color: var(--clr-text-muted, #64748b);
}

.password-action-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.password-output-wrap {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.password-output-input {
  flex: 1;
  min-width: 0;
  height: 54px;
  padding: 0 14px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 14px;
  font-size: 17px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--clr-text, #111827);
  background: #f8fafc;
}

.password-output-input:focus {
  outline: 2px solid rgba(24, 96, 156, .15);
  border-color: var(--clr-primary, #18609C);
}

.password-eye-btn {
  min-width: 60px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 14px;
  background: #fff;
  color: var(--clr-text, #111827);
  font-weight: 700;
  cursor: pointer;
}

.password-strength-box {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 14px;
  background: #f8fafc;
}

.password-strength-head span {
  font-size: 13px;
  font-weight: 700;
  color: var(--clr-primary, #18609C);
}

.password-strength-bar {
  height: 9px;
  margin-top: 12px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.password-strength-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--clr-primary, #18609C);
  transition: width .2s ease;
}

.password-strength-box p {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--clr-text-muted, #64748b);
}

.password-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

@media (max-width: 960px) {
  .password-tool-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .password-option-card,
  .password-result-card {
    padding: 18px;
    border-radius: 16px;
  }

  .password-option-grid,
  .password-stat-grid {
    grid-template-columns: 1fr;
  }

  .password-output-wrap {
    flex-direction: column;
  }

  .password-eye-btn {
    min-height: 44px;
  }

  .password-action-row .tool-primary-btn {
    width: 100%;
  }
}


/* ========================================================================== */
/* 내 IP 확인 도구 (/tools/my-ip) */
/* ========================================================================== */

.my-ip-page code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--clr-bg-soft, #f5f7f9);
  color: var(--clr-text, #222);
  font-size: 0.92em;
}

.my-ip-panel {
  display: grid;
  gap: 18px;
}

.my-ip-main-card {
  padding: 28px;
  border: 1px solid var(--clr-border, #e5e8eb);
  border-radius: 18px;
  background: #fff;
}

.my-ip-label {
  margin-bottom: 10px;
  color: var(--clr-text-muted, #6b7280);
  font-size: 14px;
  font-weight: 700;
}

.my-ip-value {
  margin-bottom: 12px;
  color: var(--clr-primary, #18609c);
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  word-break: break-all;
}

.my-ip-desc {
  margin: 0 0 20px;
  color: var(--clr-text-muted, #6b7280);
  font-size: 15px;
  line-height: 1.7;
}

.my-ip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.my-ip-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.my-ip-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.my-ip-detail-card {
  padding: 18px;
  border: 1px solid var(--clr-border, #e5e8eb);
  border-radius: 14px;
  background: #fff;
}

.my-ip-detail-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--clr-text-muted, #6b7280);
  font-size: 13px;
  font-weight: 700;
}

.my-ip-detail-card strong {
  display: block;
  color: var(--clr-text, #222);
  font-size: 15px;
  line-height: 1.5;
  word-break: break-all;
}

@media (max-width: 768px) {
  .my-ip-main-card {
    padding: 22px;
  }

  .my-ip-info-grid,
  .my-ip-detail-grid {
    grid-template-columns: 1fr;
  }

  .my-ip-actions {
    flex-direction: column;
  }

  .my-ip-actions .tool-primary-btn,
  .my-ip-actions .tool-secondary-btn {
    width: 100%;
  }
}


/* ========================================================================== */
/* QR 코드 생성기 (/tools/qr-generator) */
/* ========================================================================== */

.qr-tool-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 20px;
  align-items: start;
}

.qr-input-card,
.qr-result-card {
  background: #fff;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 18px;
  padding: 22px;
}

.qr-textarea {
  min-height: 180px;
}

.qr-option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.qr-option-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  color: var(--clr-text-muted, #6b7280);
  font-weight: 600;
}

.tool-select,
.tool-color-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 10px;
  padding: 0 10px;
  background: #fff;
  color: var(--clr-text, #111827);
  font-size: 14px;
}

.tool-color-input {
  padding: 4px;
}

.qr-preview-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  margin-top: 16px;
  border: 1px dashed var(--clr-border, #d1d5db);
  border-radius: 16px;
  background: #f9fafb;
  text-align: center;
  color: var(--clr-text-muted, #6b7280);
}

.qr-preview-box img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  background: #fff;
}

@media (max-width: 992px) {
  .qr-tool-panel {
    grid-template-columns: 1fr;
  }

  .qr-option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .qr-option-grid {
    grid-template-columns: 1fr;
  }

  .qr-input-card,
  .qr-result-card {
    padding: 18px;
  }

  .qr-preview-box {
    min-height: 280px;
  }
}


/* QR 생성기 - 상태 카드 안정화 */
.qr-generator-page .url-stat-grid,
.qr-generator-page .qr-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.qr-generator-page .word-stat-card {
  min-width: 0;
  padding: 16px 10px;
  border-radius: 16px;
  overflow: hidden;
}

.qr-generator-page .word-stat-card span {
  display: block;
  min-height: 18px;
  color: var(--clr-text, #111827);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  word-break: keep-all;
}

.qr-generator-page .word-stat-card strong {
  display: block;
  max-width: 100%;
  margin-top: 8px;
  color: var(--clr-primary, #18609C);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.qr-generator-page .word-stat-card em {
  display: block;
  margin-top: 7px;
  color: var(--clr-text-muted, #6b7280);
  font-size: 11px;
  font-style: normal;
  line-height: 1.2;
}

/* QR 크기 카드의 320px 깨짐 방지 */
.qr-generator-page #qrSizeStat {
  font-size: 26px;
  letter-spacing: -0.08em;
}

/* 상태 카드의 '대기/완료/오류' 텍스트는 너무 커지지 않게 */
.qr-generator-page #qrStatusText {
  font-size: 27px;
  letter-spacing: -0.06em;
}

@media (max-width: 992px) {
  .qr-generator-page .url-stat-grid,
  .qr-generator-page .qr-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .qr-generator-page .url-stat-grid,
  .qr-generator-page .qr-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qr-generator-page .word-stat-card {
    padding: 16px 12px;
  }

  .qr-generator-page .word-stat-card strong,
  .qr-generator-page #qrSizeStat,
  .qr-generator-page #qrStatusText {
    font-size: 30px;
  }
}

@media (max-width: 420px) {
  .qr-generator-page .word-stat-card strong,
  .qr-generator-page #qrSizeStat,
  .qr-generator-page #qrStatusText {
    font-size: 26px;
  }
}


/* ========================================================================== */
/* HTTP 상태 확인기 (/tools/http-status) */
/* ========================================================================== */

.http-tool-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  gap: 20px;
  align-items: start;
}

.http-input-card,
.http-result-card {
  background: #fff;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 18px;
  padding: 22px;
}

.http-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 16px;
}

.http-url-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 12px;
  padding: 0 14px;
  background: #fff;
  color: var(--clr-text, #111827);
  font-size: 15px;
  outline: none;
}

.http-url-input:focus {
  border-color: var(--clr-primary, #18609C);
  box-shadow: 0 0 0 3px rgba(24, 96, 156, 0.12);
}

.http-option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.http-check-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 999px;
  background: #fff;
  color: var(--clr-text-muted, #6b7280);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.http-check-option input {
  accent-color: var(--clr-primary, #18609C);
}

.http-help-box {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 14px;
  background: var(--clr-bg-soft, #f9fafb);
  color: var(--clr-text-muted, #6b7280);
  font-size: 13px;
  line-height: 1.55;
}

.http-help-box strong {
  color: var(--clr-text, #111827);
  font-weight: 700;
}

.http-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.http-status-page .word-stat-card {
  min-width: 0;
  padding: 16px 10px;
  border-radius: 16px;
  overflow: hidden;
}

.http-status-page .word-stat-card span {
  display: block;
  min-height: 18px;
  font-size: 12px;
  line-height: 1.3;
  word-break: keep-all;
}

.http-status-page .word-stat-card strong {
  display: block;
  max-width: 100%;
  margin-top: 8px;
  color: var(--clr-primary, #18609C);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
  overflow: hidden;
}

.http-status-page .word-stat-card em {
  display: block;
  margin-top: 7px;
  color: var(--clr-text-muted, #6b7280);
  font-size: 11px;
  font-style: normal;
  line-height: 1.2;
}

.http-status-page #httpFinalState {
  font-size: 24px;
  letter-spacing: -0.06em;
}

.http-status-page .is-good { color: #047857 !important; }
.http-status-page .is-move { color: #18609C !important; }
.http-status-page .is-warn { color: #b45309 !important; }
.http-status-page .is-bad { color: #b91c1c !important; }

.http-detail-box,
.http-chain-box {
  margin-top: 16px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.http-detail-list {
  margin: 0;
}

.http-detail-list div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--clr-border, #e5e7eb);
}

.http-detail-list div:last-child {
  border-bottom: 0;
}

.http-detail-list dt {
  color: var(--clr-text-muted, #6b7280);
  font-size: 13px;
  font-weight: 700;
}

.http-detail-list dd {
  margin: 0;
  color: var(--clr-text, #111827);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-all;
}

.http-chain-box {
  padding: 16px;
}

.http-chain-box h3 {
  margin: 0 0 12px;
  color: var(--clr-text, #111827);
  font-size: 15px;
}

.http-chain-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.http-chain-item {
  padding: 12px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 14px;
  background: var(--clr-bg-soft, #f9fafb);
}

.http-chain-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.http-chain-head strong {
  color: var(--clr-text, #111827);
  font-size: 13px;
}

.http-chain-head em {
  margin-left: auto;
  color: var(--clr-text-muted, #6b7280);
  font-size: 12px;
  font-style: normal;
}

.http-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--clr-text, #111827);
  font-size: 12px;
  font-weight: 800;
}

.http-chain-item p,
.http-chain-item small {
  display: block;
  margin: 0;
  color: var(--clr-text-muted, #6b7280);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-all;
}

.http-chain-item small {
  margin-top: 6px;
}

.http-code-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.http-code-card {
  padding: 18px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 18px;
  background: #fff;
}

.http-code-card strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 34px;
  border-radius: 999px;
  background: rgba(24, 96, 156, 0.09);
  color: var(--clr-primary, #18609C);
  font-size: 15px;
  font-weight: 800;
}

.http-code-card h3 {
  margin: 12px 0 8px;
  color: var(--clr-text, #111827);
  font-size: 16px;
}

.http-code-card p {
  margin: 0;
  color: var(--clr-text-muted, #6b7280);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 992px) {
  .http-tool-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .http-input-row {
    grid-template-columns: 1fr;
  }

  .http-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .http-code-grid {
    grid-template-columns: 1fr;
  }

  .http-detail-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}


/* ==========================================================================
   JSON 정렬기 (/tools/json-formatter)
   ========================================================================== */

.json-tool-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.json-input-card,
.json-result-card {
  background: #fff;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 18px;
  padding: 22px;
}

.json-textarea {
  min-height: 340px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.65;
  tab-size: 2;
  white-space: pre;
}

.json-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.json-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.json-formatter-page .word-stat-card {
  min-width: 0;
  padding: 16px 10px;
  border-radius: 16px;
  overflow: hidden;
}

.json-formatter-page .word-stat-card span {
  display: block;
  color: var(--clr-text, #111827);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  word-break: keep-all;
}

.json-formatter-page .word-stat-card strong {
  display: block;
  max-width: 100%;
  margin-top: 8px;
  color: var(--clr-primary, #18609C);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
  overflow: hidden;
}

.json-formatter-page .word-stat-card em {
  display: block;
  margin-top: 7px;
  color: var(--clr-text-muted, #6b7280);
  font-size: 11px;
  font-style: normal;
  line-height: 1.2;
}

.json-formatter-page #jsonStateText {
  font-size: 25px;
  letter-spacing: -0.06em;
}

@media (max-width: 992px) {
  .json-tool-panel {
    grid-template-columns: 1fr;
  }

  .json-textarea {
    min-height: 280px;
  }
}

@media (max-width: 768px) {
  .json-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .json-action-row .tool-primary-btn,
  .json-action-row .tool-secondary-btn {
    flex: 1 1 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .json-input-card,
  .json-result-card {
    padding: 18px;
  }

  .json-textarea {
    min-height: 240px;
    font-size: 12px;
  }
}


/* ==========================================================================
   PDF 편집기 (/tools/pdf-editor)
   ========================================================================== */

.pdf-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pdf-mode-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 14px 16px;
  border: 1px solid var(--clr-border, #dbe2ea);
  border-radius: 12px;
  background: #fff;
  color: var(--clr-text, #111827);
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}

.pdf-mode-card strong {
  font-size: 16px;
  line-height: 1.3;
}

.pdf-mode-card em {
  grid-column: 2;
  color: var(--clr-text-muted, #6b7280);
  font-size: 12px;
  font-style: normal;
  line-height: 1.3;
}

.pdf-mode-card.is-active {
  border-color: rgba(24, 96, 156, .35);
  background: rgba(24, 96, 156, .08);
}

.pdf-mode-icon {
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--clr-primary, #18609C);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}

.pdf-editor-card,
.pdf-help-card {
  background: #fff;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 18px;
  padding: 22px;
}

.pdf-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 132px;
  margin-top: 18px;
  border: 2px dashed var(--clr-border, #d1d5db);
  border-radius: 16px;
  background: #fafafa;
  color: var(--clr-text-muted, #6b7280);
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}

.pdf-drop-zone:hover,
.pdf-drop-zone.is-dragover {
  border-color: var(--clr-primary, #18609C);
  background: rgba(24, 96, 156, .05);
}

.pdf-drop-zone strong {
  margin-top: 8px;
  color: var(--clr-text, #111827);
  font-size: 14px;
  line-height: 1.5;
}

.pdf-drop-zone em {
  margin-top: 4px;
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
}

.pdf-drop-icon {
  color: var(--clr-text-muted, #6b7280);
  font-size: 38px;
  line-height: 1;
}

.pdf-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.pdf-editor-page .word-stat-card {
  min-width: 0;
  padding: 16px 10px;
  border-radius: 16px;
  overflow: hidden;
}

.pdf-editor-page .word-stat-card span {
  display: block;
  color: var(--clr-text, #111827);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  word-break: keep-all;
}

.pdf-editor-page .word-stat-card strong {
  display: block;
  max-width: 100%;
  margin-top: 8px;
  color: var(--clr-primary, #18609C);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
  overflow: hidden;
}

.pdf-editor-page .word-stat-card em {
  display: block;
  margin-top: 7px;
  color: var(--clr-text-muted, #6b7280);
  font-size: 11px;
  font-style: normal;
  line-height: 1.2;
}

.pdf-editor-page #pdfStateText {
  font-size: 25px;
  letter-spacing: -0.06em;
}

.pdf-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.pdf-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(162px, 1fr));
  gap: 16px;
}

.pdf-page-card {
  background: #fff;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 16px;
  padding: 12px;
  transition: opacity .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.pdf-page-card.is-disabled {
  opacity: .45;
}

.pdf-page-card.is-sorting {
  border-color: var(--clr-primary, #18609C);
  box-shadow: 0 12px 30px rgba(15, 23, 42, .12);
}

.pdf-page-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 190px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 12px;
  background: #f9fafb;
  overflow: hidden;
  cursor: grab;
}

.pdf-page-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #fff;
}

.pdf-thumb-loading {
  color: var(--clr-text-muted, #6b7280);
  font-size: 13px;
}

.pdf-page-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.pdf-page-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--clr-text, #111827);
  font-size: 13px;
  font-weight: 600;
}

.pdf-page-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--clr-primary, #18609C);
}

.pdf-page-rotate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 30px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 8px;
  background: #fff;
  color: var(--clr-primary, #18609C);
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

.pdf-page-title {
  margin-top: 10px;
}

.pdf-page-title strong,
.pdf-page-title span,
.pdf-page-rotation {
  display: block;
}

.pdf-page-title strong {
  color: var(--clr-text, #111827);
  font-size: 14px;
  line-height: 1.35;
}

.pdf-page-title span,
.pdf-page-rotation {
  margin-top: 3px;
  color: var(--clr-text-muted, #6b7280);
  font-size: 12px;
  line-height: 1.35;
}

.pdf-help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.pdf-help-grid strong {
  display: block;
  margin-bottom: 10px;
  color: var(--clr-text, #111827);
  font-size: 15px;
}

.pdf-help-grid ul {
  margin: 0;
  padding-left: 18px;
  color: var(--clr-text-muted, #6b7280);
  font-size: 13px;
  line-height: 1.8;
}

.pdf-local-note {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--clr-border, #e5e7eb);
  color: var(--clr-text-muted, #6b7280);
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 992px) {
  .pdf-mode-grid,
  .pdf-help-grid {
    grid-template-columns: 1fr;
  }

  .pdf-page-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width: 768px) {
  .pdf-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pdf-toolbar .tool-primary-btn,
  .pdf-toolbar .tool-secondary-btn {
    flex: 1 1 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .pdf-editor-card,
  .pdf-help-card {
    padding: 18px;
  }

  .pdf-mode-card {
    grid-template-columns: 38px minmax(0, 1fr);
    padding: 12px 14px;
  }

  .pdf-mode-icon {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  .pdf-page-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .pdf-page-thumb {
    height: 150px;
  }

  .pdf-drop-zone {
    min-height: 120px;
    padding: 18px 12px;
  }
}


/* ==========================================================================
   특수문자/이모지 검색기 (/tools/symbol-emoji)
   ========================================================================== */

.symbol-search-card,
.symbol-result-card,
.symbol-help-card,
.symbol-recent-card {
  background: #fff;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 18px;
  padding: 24px;
}

/* 검색 박스 */
.symbol-search-label {
  display: block;
  margin-bottom: 10px;
  color: var(--clr-text, #111827);
  font-size: 14px;
  font-weight: 700;
}

.symbol-search-box {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
}

.symbol-search-box span {
  color: var(--clr-text-muted, #6b7280);
  font-size: 22px;
  line-height: 1;
  text-align: center;
}

.symbol-search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--clr-text, #111827);
  font-size: 15px;
  line-height: 1.5;
}

.symbol-search-box input::placeholder {
  color: var(--clr-text-muted, #9ca3af);
}

.symbol-search-box button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--clr-text-muted, #6b7280);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.symbol-search-box button:hover {
  background: #f3f4f6;
  color: var(--clr-text, #111827);
}

.symbol-status {
  margin: 10px 0 0;
  color: var(--clr-text-muted, #6b7280);
  font-size: 13px;
  line-height: 1.5;
}

/* 최근 복사 박스 */
.symbol-recent-section {
  margin-top: -12px;
}

.symbol-recent-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
}

.symbol-recent-head {
  flex: 0 0 auto;
  min-width: 110px;
}

.symbol-recent-head strong {
  display: block;
  color: var(--clr-text, #111827);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}

.symbol-recent-head span {
  display: block;
  margin-top: 3px;
  color: var(--clr-text-muted, #6b7280);
  font-size: 12px;
  line-height: 1.35;
}

.symbol-recent-list {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.symbol-recent-chip {
  position: relative;
  display: inline-grid;
  grid-template-columns: 28px minmax(0, auto);
  align-items: center;
  gap: 6px;
  max-width: 150px;
  min-height: 36px;
  padding: 5px 10px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 10px;
  background: #fff;
  color: var(--clr-text, #111827);
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.symbol-recent-chip:hover {
  border-color: rgba(24, 96, 156, .45);
  box-shadow: 0 6px 16px rgba(15, 23, 42, .08);
  transform: translateY(-1px);
}

.symbol-recent-chip strong {
  font-size: 20px;
  line-height: 1;
  text-align: center;
}

.symbol-recent-chip span {
  min-width: 0;
  color: var(--clr-text-muted, #6b7280);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 탭 / 최근 복사 영역 */
.symbol-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.symbol-type-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #f3f4f6;
}

.symbol-type-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--clr-text, #111827);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.symbol-type-btn span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fff;
  color: var(--clr-text, #111827);
  font-size: 12px;
  font-weight: 800;
}

.symbol-type-btn.is-active {
  background: #fff;
  box-shadow: 0 0 0 1px rgba(17, 24, 39, .08), 0 2px 6px rgba(15, 23, 42, .08);
}

/* 카테고리 버튼 */
.symbol-category-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.symbol-category-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 9px;
  background: #fff;
  color: var(--clr-text, #111827);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.symbol-category-btn:hover {
  border-color: rgba(17, 24, 39, .28);
  background: #f9fafb;
}

.symbol-category-btn.is-active {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

/* 결과 그리드 */
.symbol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  padding: 2px 4px 2px 0;
}

.symbol-grid::-webkit-scrollbar {
  width: 8px;
}

.symbol-grid::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #d1d5db;
}

.symbol-grid::-webkit-scrollbar-track {
  background: transparent;
}

.symbol-item-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 82px;
  padding: 10px 8px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 10px;
  background: #fff;
  color: var(--clr-text, #111827);
  text-align: center;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.symbol-item-card:hover {
  border-color: rgba(24, 96, 156, .45);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
  transform: translateY(-1px);
}

.symbol-item-card strong {
  display: block;
  width: 100%;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 500;
}

.symbol-item-card span {
  display: block;
  width: 100%;
  margin-top: 7px;
  color: var(--clr-text-muted, #6b7280);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.symbol-empty {
  padding: 40px 16px;
  color: var(--clr-text-muted, #6b7280);
  font-size: 14px;
  text-align: center;
}

/* 클릭 복사 완료 체크 표시 */
.symbol-item-card.is-copied::after,
.symbol-recent-chip.is-copied::after {
  content: "✓";
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background: rgba(17, 24, 39, .78);
  color: #fff;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.symbol-recent-chip.is-copied::after {
  font-size: 22px;
}

/* 사용법 */
.symbol-help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.symbol-help-grid strong {
  display: block;
  margin-bottom: 10px;
  color: var(--clr-text, #111827);
  font-size: 15px;
}

.symbol-help-grid ul {
  margin: 0;
  padding-left: 18px;
  color: var(--clr-text-muted, #6b7280);
  font-size: 13px;
  line-height: 1.9;
}

/* 반응형 */
@media (max-width: 992px) {
  .symbol-grid {
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  }

  .symbol-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .symbol-recent-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .symbol-recent-list {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .symbol-search-card,
  .symbol-result-card,
  .symbol-help-card,
  .symbol-recent-card {
    padding: 18px;
  }

  .symbol-recent-section {
    margin-top: -8px;
  }

  .symbol-help-grid {
    grid-template-columns: 1fr;
  }

  .symbol-type-tabs {
    width: 100%;
  }

  .symbol-type-btn {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .symbol-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    max-height: 480px;
  }

  .symbol-item-card {
    min-height: 76px;
    padding: 9px 6px;
  }

  .symbol-item-card strong {
    font-size: 26px;
  }

  .symbol-item-card span {
    font-size: 11px;
  }

  .symbol-recent-chip {
    max-width: 120px;
  }
}

/* ==========================================================================
   로또 번호 생성기 (/tools/lotto-generator)
   ========================================================================== */

.lotto-tool-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 20px;
  align-items: start;
}

.lotto-option-card,
.lotto-result-card,
.lotto-guide-card {
  background: #fff;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 18px;
  padding: 22px;
}

.lotto-setting-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.lotto-setting-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--clr-text-muted, #6b7280);
  font-size: 13px;
  font-weight: 700;
}

.lotto-number-section {
  margin-top: 22px;
}

.lotto-section-head h3 {
  margin: 0;
  color: var(--clr-text, #111827);
  font-size: 16px;
  line-height: 1.4;
}

.lotto-section-head p {
  margin: 5px 0 0;
  color: var(--clr-text-muted, #6b7280);
  font-size: 13px;
  line-height: 1.5;
}

.lotto-number-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.lotto-number-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 10px;
  background: #fff;
  color: var(--clr-text, #111827);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.lotto-number-btn:hover {
  border-color: rgba(24, 96, 156, .45);
  transform: translateY(-1px);
}

.lotto-number-btn.is-active {
  border-color: var(--clr-primary, #18609C);
  background: var(--clr-primary, #18609C);
  color: #fff;
}

.lotto-number-btn:disabled {
  opacity: .28;
  cursor: not-allowed;
  transform: none;
}

.lotto-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.lotto-result-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 190px;
}

.lotto-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 190px;
  border: 1px dashed var(--clr-border, #d1d5db);
  border-radius: 14px;
  color: var(--clr-text-muted, #6b7280);
  font-size: 14px;
  text-align: center;
}

.lotto-result-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 14px;
  background: #f9fafb;
}

.lotto-result-label {
  color: var(--clr-text, #111827);
  font-size: 13px;
  font-weight: 800;
}

.lotto-ball-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lotto-ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  font-style: normal;
  line-height: 1;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .16);
}

.lotto-range-1 {
  background: #f5b400;
}

.lotto-range-2 {
  background: #3b82f6;
}

.lotto-range-3 {
  background: #ef4444;
}

.lotto-range-4 {
  background: #6b7280;
}

.lotto-range-5 {
  background: #22c55e;
}

.lotto-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.lotto-generator-page .word-stat-card {
  min-width: 0;
  padding: 16px 10px;
  border-radius: 16px;
  overflow: hidden;
}

.lotto-generator-page .word-stat-card span {
  display: block;
  color: var(--clr-text, #111827);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.lotto-generator-page .word-stat-card strong {
  display: block;
  max-width: 100%;
  margin-top: 8px;
  color: var(--clr-primary, #18609C);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
  overflow: hidden;
}

.lotto-generator-page .word-stat-card em {
  display: block;
  margin-top: 7px;
  color: var(--clr-text-muted, #6b7280);
  font-size: 11px;
  font-style: normal;
  line-height: 1.2;
}

.lotto-generator-page #lottoStatState {
  font-size: 25px;
  letter-spacing: -0.06em;
}

.lotto-color-guide {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.lotto-color-guide span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--clr-text, #111827);
  font-size: 13px;
  font-weight: 700;
}

.lotto-color-guide .lotto-ball {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.lotto-note {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--clr-border, #e5e7eb);
  color: var(--clr-text-muted, #6b7280);
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 1100px) {
  .lotto-tool-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .lotto-setting-grid {
    grid-template-columns: 1fr;
  }

  .lotto-number-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .lotto-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lotto-action-row .tool-primary-btn,
  .lotto-action-row .tool-secondary-btn {
    flex: 1 1 100%;
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .lotto-option-card,
  .lotto-result-card,
  .lotto-guide-card {
    padding: 18px;
  }

  .lotto-number-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .lotto-number-btn {
    min-height: 32px;
    font-size: 12px;
  }

  .lotto-result-item {
    grid-template-columns: 1fr;
  }

  .lotto-ball {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }
}
