/* ============================================================
   깨알도구
   글자 수 세기

   공통 페이지 / 패널 / 버튼 / 입력 스타일은
   tool-common.css 사용
   ============================================================ */

.character-count-page {
  --tool-page-max-width: 920px;
}

/* ============================================================
   TEXTAREA
   ============================================================ */

.counter-textarea {
  display: block;

  width: 100%;
  min-height: 340px;

  padding: 14px 15px;

  resize: vertical;

  border: 1px solid var(--line);
  border-radius: var(--tool-input-radius);

  background: #ffffff;

  color: var(--text);

  outline: none;

  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.75;

  box-sizing: border-box;

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.counter-textarea:focus {
  border-color: var(--accent);

  box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.1);
}

.counter-textarea::placeholder {
  color: #aaa9a3;
}

/* ============================================================
   INPUT META
   ============================================================ */

.counter-input-meta {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 10px;

  margin-top: 6px;

  color: var(--text-soft);

  font-size: var(--tool-help-size);
  line-height: 1.5;
}

.counter-input-meta span:last-child {
  flex: 0 0 auto;

  font-variant-numeric: tabular-nums;
}

/* ============================================================
   RESULT PANEL
   ============================================================ */

.counter-result-panel {
  min-height: 0;

  justify-content: flex-start;
}

/* ============================================================
   STATUS
   ============================================================ */

.counter-status {
  width: 100%;

  min-height: 35px;

  display: flex;

  align-items: center;
  justify-content: center;

  margin-bottom: 13px;

  padding: 7px 10px;

  border-radius: 9px;

  background: var(--surface-soft);

  color: var(--text-soft);

  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;

  text-align: center;

  box-sizing: border-box;
}

.counter-status.is-active {
  background: #eef8f1;

  color: #39734b;
}

/* ============================================================
   MAIN COUNT
   ============================================================ */

.counter-main {
  padding: 24px 15px;

  border-radius: 14px;

  background: linear-gradient(145deg, #1d2433, #111722);

  color: #ffffff;

  text-align: center;
}

.counter-main span {
  display: block;

  color: rgba(255, 255, 255, 0.62);

  font-size: 12px;
  font-weight: 800;
}

.counter-main strong {
  display: inline-block;

  margin-top: 3px;

  font-size: 46px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -2px;

  font-variant-numeric: tabular-nums;
}

.counter-main small {
  margin-left: 4px;

  color: #ffd979;

  font-size: 12px;
  font-weight: 800;
}

/* ============================================================
   PRIMARY GRID
   ============================================================ */

.counter-primary-grid {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 7px;

  margin-top: 10px;
}

.counter-primary-grid > div {
  min-width: 0;

  padding: 13px 10px;

  border: 1px solid var(--line);
  border-radius: 11px;

  background: #ffffff;

  text-align: center;
}

.counter-primary-grid span {
  display: block;

  color: var(--text-soft);

  font-size: 12px;
  font-weight: 750;
}

.counter-primary-grid strong {
  display: inline-block;

  margin-top: 3px;

  color: var(--text);

  font-size: 23px;
  font-weight: 900;

  font-variant-numeric: tabular-nums;
}

.counter-primary-grid small {
  margin-left: 2px;

  color: var(--text-soft);

  font-size: 12px;
}

/* ============================================================
   DETAIL STATS
   ============================================================ */

.counter-stat-grid {
  display: grid;

  grid-template-columns: repeat(4, minmax(0, 1fr));

  gap: 6px;

  margin-top: 7px;
}

.counter-stat {
  min-width: 0;

  padding: 10px 5px;

  border-radius: 9px;

  background: var(--surface-soft);

  text-align: center;
}

.counter-stat span {
  display: block;

  color: var(--text-soft);

  font-size: 12px;
  font-weight: 750;
}

.counter-stat strong {
  display: block;

  margin-top: 3px;

  color: var(--text);

  font-size: 12px;
  font-weight: 900;

  font-variant-numeric: tabular-nums;

  overflow-wrap: anywhere;
}

/* ============================================================
   TARGET
   ============================================================ */

.counter-target {
  margin-top: 15px;

  padding: 13px;

  border: 1px solid var(--line);
  border-radius: 11px;

  background: #ffffff;
}

.counter-target-head {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 10px;
}

.counter-target-head span {
  display: block;

  color: var(--text);

  font-size: 12px;
  font-weight: 850;
}

.counter-target-head strong {
  display: block;

  margin-top: 2px;

  color: var(--text-soft);

  font-size: 12px;
  font-weight: 700;
}

.counter-target-head b {
  flex: 0 0 auto;

  color: var(--brand);

  font-size: 16px;
  font-weight: 900;

  font-variant-numeric: tabular-nums;
}

/* ============================================================
   PROGRESS
   ============================================================ */

.counter-progress {
  width: 100%;
  height: 10px;

  margin-top: 10px;

  overflow: hidden;

  border-radius: 999px;

  background: var(--surface-soft);
}

.counter-progress span {
  display: block;

  width: 0;
  height: 100%;

  border-radius: inherit;

  background: linear-gradient(90deg, #e0aa44, #f4cc69);

  transition: width 0.2s ease;
}

.counter-progress.is-over span {
  background: linear-gradient(90deg, #e67567, #ef9b7c);
}

/* ============================================================
   TARGET INFO
   ============================================================ */

.counter-target-info {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 10px;

  margin-top: 6px;

  color: var(--text-soft);

  font-size: 12px;
}

.counter-target-info strong {
  color: var(--text);

  font-size: 12px;
  font-weight: 800;
}

/* ============================================================
   NOTE
   ============================================================ */

.counter-note {
  margin-top: 11px;

  padding: 10px 11px;

  border-radius: 9px;

  background: var(--surface-soft);
}

.counter-note strong {
  display: block;

  color: var(--text);

  font-size: 12px;
  font-weight: 850;
}

.counter-note p {
  margin: 3px 0 0;

  color: var(--text-soft);

  font-size: 12px;
  line-height: 1.55;
}

/* ============================================================
   TABLET
   ============================================================ */

@media (max-width: 760px) {
  .counter-result-panel {
    order: -1;
  }

  .counter-textarea {
    min-height: 280px;
  }
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 520px) {
  .counter-textarea {
    min-height: 240px;

    padding: 12px;

    font-size: 13px;
  }

  .counter-main {
    padding: 20px 12px;
  }

  .counter-main strong {
    font-size: 40px;
  }

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

  .counter-target-info {
    align-items: flex-start;

    flex-direction: column;

    gap: 2px;
  }
}
