/* ============================================
   글자수세기 - 스타벅스 그린 테마
   ============================================ */

:root {
  --green-house: #1E3932;
  --green-primary: #00704A;
  --green-tint: rgba(0, 112, 74, 0.08);
  --green-tint-light: rgba(0, 112, 74, 0.04);
  --green-border: rgba(0, 112, 74, 0.2);

  --bg: #FAFAF7;
  --bg-card: #FFFFFF;
  --bg-soft: #F5F4EE;
  --text: #1F1F1F;
  --text-mute: #5F5F5F;
  --text-light: #8A8A8A;
  --border: #E8E6DE;
  --warn-bg: #FFF8E1;
  --warn-text: #8B6914;
  --warn-border: #F5D89C;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(30, 57, 50, 0.06);

  --font-sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--green-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============ HEADER ============ */
.site-header {
  background: var(--green-house);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.brand:hover { text-decoration: none; }
.brand-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green-primary);
}
.site-nav {
  display: flex;
  gap: 22px;
  font-size: 13px;
}
.site-nav a {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}
.site-nav a:hover {
  color: #fff;
  text-decoration: none;
}
.site-nav a.active {
  color: #fff;
  font-weight: 600;
}

/* ============ HERO ============ */
.hero {
  background: var(--green-tint-light);
  padding: 48px 0 36px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.hero h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--green-house);
  margin: 0 0 14px;
  letter-spacing: -0.8px;
}
.hero-desc {
  max-width: 560px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-mute);
}
.hero-desc strong {
  color: var(--green-primary);
  font-weight: 600;
}

/* ============ AD SLOT ============ */
.ad-slot {
  margin: 24px 0;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.ad-slot ins { width: 100%; }

/* ============ MAIN ============ */
main {
  padding: 24px 0 40px;
}

/* ============ TABS ============ */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab {
  flex: 0 0 auto;
  padding: 12px 22px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-mute);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--green-primary);
  border-bottom-color: var(--green-primary);
  font-weight: 600;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============ TEXTAREA ============ */
#input-text {
  width: 100%;
  min-height: 200px;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#input-text:focus {
  outline: none;
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px var(--green-tint);
}
#input-text::placeholder { color: var(--text-light); }

.textarea-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-end;
}
.btn-ghost {
  padding: 6px 14px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  color: var(--text-mute);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-ghost:hover {
  background: var(--green-tint-light);
  border-color: var(--green-primary);
  color: var(--green-primary);
}

/* ============ FILE UPLOAD ============ */
.warn-box {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.warn-icon {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--warn-text);
  color: var(--warn-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  margin-top: 1px;
}
.warn-title {
  font-size: 14px; font-weight: 600;
  color: var(--warn-text);
  margin-bottom: 4px;
}
.warn-box p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--warn-text);
}

.dropzone {
  display: block;
  text-align: center;
  padding: 40px 20px;
  background: var(--green-tint-light);
  border: 2px dashed var(--green-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s;
}
.dropzone:hover, .dropzone.drag-over {
  background: var(--green-tint);
}
.dz-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.dz-sub {
  font-size: 12px;
  color: var(--text-mute);
}
.dz-state {
  margin-top: 12px;
  font-size: 13px;
  color: var(--green-primary);
  font-weight: 500;
  min-height: 20px;
}
.dz-state.error { color: #B91C1C; }

.file-preview {
  margin-top: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.file-preview-head {
  padding: 10px 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mute);
}
.file-preview pre {
  margin: 0;
  padding: 14px;
  max-height: 200px;
  overflow: auto;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text-mute);
}

/* ============ COUNTER CARD ============ */
.counter-card {
  margin: 20px 0 14px;
  padding: 24px 26px;
  background: var(--green-tint);
  border-radius: var(--radius-lg);
}
.counter-row + .counter-row {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--green-border);
}
.counter-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--green-primary);
  margin-bottom: 8px;
}
.counter-main {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.counter-num {
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  color: var(--green-house);
  letter-spacing: -1px;
}
.counter-bytes {
  font-size: 14px;
  color: var(--text-mute);
  font-weight: 500;
}
.counter-bytes .dot {
  opacity: 0.4;
  margin: 0 2px;
}

/* ============ STATS GRID ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}
.stat {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
}
.stat-label {
  font-size: 12px;
  color: var(--text-mute);
  margin-bottom: 4px;
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--green-house);
  letter-spacing: -0.5px;
}

/* ============ CONTENT SECTIONS ============ */
.content-section {
  margin-top: 40px;
}
.content-section h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 18px;
  color: var(--green-house);
  letter-spacing: -0.4px;
}
.h2-underline {
  display: inline-block;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--green-primary);
}

/* 이용방법 STEPS */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.step {
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--green-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.step p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-mute);
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq-item {
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.faq-item h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.faq-item .q-mark {
  color: var(--green-primary);
  font-weight: 700;
  flex-shrink: 0;
}
.faq-item p {
  margin: 0;
  padding-left: 32px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-mute);
}

/* ============ TEXT PAGE (소개, 개인정보처리방침) ============ */
.text-page {
  padding: 40px 0 60px;
  max-width: 720px;
  margin: 0 auto;
}
.text-page h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--green-house);
  margin: 0 0 12px;
  letter-spacing: -0.6px;
}
.text-page .meta {
  font-size: 13px;
  color: var(--text-light);
  margin: 0 0 28px;
}
.text-page h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--green-primary);
  margin: 32px 0 10px;
  letter-spacing: -0.3px;
}
.text-page p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  margin: 0 0 12px;
}
.text-page ul {
  margin: 0 0 12px;
  padding-left: 22px;
}
.text-page li {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
}

/* ============ FOOTER ============ */
.site-footer {
  background: var(--green-house);
  color: rgba(255, 255, 255, 0.6);
  padding: 24px 0;
  margin-top: 60px;
  font-size: 12px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}
.footer-nav {
  display: flex;
  gap: 16px;
}
.site-footer a {
  color: rgba(255, 255, 255, 0.6);
}
.site-footer a:hover { color: #fff; text-decoration: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .header-inner { padding: 12px 16px; }
  .brand { font-size: 16px; }
  .site-nav { gap: 14px; font-size: 12px; }

  .hero { padding: 36px 0 28px; }
  .hero h1 { font-size: 26px; letter-spacing: -0.5px; }
  .hero-desc { font-size: 14px; }

  .tab { padding: 10px 14px; font-size: 13px; }

  .counter-card { padding: 20px 18px; }
  .counter-num { font-size: 30px; }
  .counter-bytes { font-size: 13px; width: 100%; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }

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

  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 380px) {
  .counter-num { font-size: 26px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-value { font-size: 20px; }
}
