/* ========== Reset / Base ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --line: #e6ebf2;
  --line-strong: #d7dee9;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #0ea371;
  --primary-dark: #087a56;
  --primary-soft: #e8fbf4;
  --blue: #2563eb;
  --blue-soft: #edf4ff;
  --danger: #dc2626;
  --danger-soft: #fff1f1;
  --warning: #f59e0b;
  --warning-soft: #fff7e6;
  --shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
  --shadow-sm: 0 4px 12px rgba(16, 24, 40, 0.06);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
}

html,
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #f7fafc 0%, #f1f5f9 100%);
  color: var(--text);
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  line-height: 1.5;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ========== Layout ========== */
.zzoa-wrap {
  width: min(1180px, calc(100% - 28px));
  margin: 18px auto 36px;
  display: grid;
  gap: 18px;
}

/* ========== Hero ========== */
.hero-card {
  background: linear-gradient(135deg, #0ec28a 0%, #0c9d71 45%, #0a7f63 100%);
  border-radius: 24px;
  box-shadow: 0 12px 28px rgba(8, 122, 86, 0.24);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero-card::before,
.hero-card::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.15;
}
.hero-card::before {
  width: 220px;
  height: 220px;
  right: -60px;
  top: -60px;
  background: #fff;
}
.hero-card::after {
  width: 180px;
  height: 180px;
  left: -40px;
  bottom: -60px;
  background: #fff;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 28px 28px 24px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  font-size: 13px;
  font-weight: 600;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: #d4ffe8;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(212,255,232,0.18);
}

.hero-content h1 {
  margin: 4px 0 8px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero-content p {
  margin: 0 auto;
  max-width: 760px;
  color: rgba(255,255,255,0.92);
  font-size: 15px;
}

.hero-content p strong {
  color: #fff;
  font-weight: 800;
}

.hero-actions {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ========== Buttons ========== */
.btn {
  height: 44px;
  border-radius: 12px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease;
  border: 1px solid transparent;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-icon {
  width: 18px;
  height: 18px;
  color: currentColor;
}
.btn-icon svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: linear-gradient(180deg, #0ea371 0%, #0a875e 100%);
  color: #fff;
  box-shadow: 0 8px 16px rgba(14, 163, 113, 0.24);
}

.btn-primary:hover {
  box-shadow: 0 10px 18px rgba(14, 163, 113, 0.28);
}

.btn-secondary {
  background: #fff;
  border-color: var(--line-strong);
  color: #1f2937;
}

.btn-danger {
  background: linear-gradient(180deg, #6b7280 0%, #4b5563 100%);
  color: #fff;
  box-shadow: 0 6px 14px rgba(75, 85, 99, 0.2);
}

.btn-danger:hover {
  box-shadow: 0 8px 16px rgba(75, 85, 99, 0.24);
}

.btn-ghost {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
}

.btn-hero {
  min-width: 158px;
}

/* ========== Tool Card ========== */
.tool-card {
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(230,235,242,0.7);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
  padding: 18px;
}

.tool-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.tool-title {
  display: flex;
  gap: 12px;
  align-items: center;
}

.tool-title-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  border: 1px solid #c8f3e2;
  flex: 0 0 auto;
}
.tool-title-icon svg {
  width: 22px;
  height: 22px;
}

.tool-title h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.tool-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.tool-top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-btn {
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  color: #334155;
  box-shadow: var(--shadow-sm);
}
.icon-btn:hover {
  border-color: #bfd2f5;
  background: #f8fbff;
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}

.input-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}

.text-input {
  width: 100%;
  min-height: 210px;
  resize: vertical;
  border: 1px solid #dce3ee;
  border-radius: 14px;
  padding: 16px 16px;
  font-size: 15px;
  line-height: 1.7;
  color: #111827;
  background: #fbfcff;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.text-input::placeholder {
  color: #9ca3af;
}

.text-input:focus {
  outline: none;
  border-color: #91bafc;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37,99,235,0.10);
}

.input-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  user-select: none;
}

.toggle-chip input {
  margin: 0;
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
}

.action-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ========== Result Panel ========== */
.result-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  padding: 14px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.result-title-wrap {
  display: flex;
  gap: 10px;
  align-items: center;
}

.result-title-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid #dbeafe;
}
.result-title-icon svg {
  width: 21px;
  height: 21px;
}

.result-title-wrap h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.result-title-wrap p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.icon-only-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  display: grid;
  place-items: center;
  color: #475569;
}
.icon-only-btn:hover {
  background: #f8fbff;
  border-color: #bfd2f5;
}
.icon-only-btn svg {
  width: 18px;
  height: 18px;
}

.highlight-banner {
  margin-top: 12px;
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid #c7f1df;
  background: linear-gradient(180deg, #f1fff9 0%, #eafff5 100%);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.highlight-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.highlight-left strong {
  color: #0a7f63;
  font-size: 14px;
  font-weight: 800;
}
.highlight-left span {
  color: #0f5132;
  font-size: 13px;
}

.highlight-right {
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid #ccecdf;
  color: #0a7f63;
  font-size: 12px;
  font-weight: 700;
}

.stats-grid {
  margin-top: 14px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px 12px;
  box-shadow: var(--shadow-sm);
  min-height: 126px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-card.stat-emphasis {
  border-color: #bdebd9;
  background: linear-gradient(180deg, #ffffff 0%, #f6fff9 100%);
  box-shadow: 0 8px 16px rgba(14, 163, 113, 0.10);
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  color: var(--primary);
  background: #eefdf6;
  border: 1px solid #d4f8e9;
}
.stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-label {
  font-size: 12px;
  color: #475569;
  font-weight: 700;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-value {
  margin-top: 4px;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #0f172a;
  word-break: break-all;
}

.stat-desc {
  margin-top: 6px;
  font-size: 11px;
  color: #94a3b8;
}

/* ========== Limit checker ========== */
.limit-checker {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
}

.limit-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.limit-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: #1f2937;
}

.chip-icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #f2f7ff;
  color: #2563eb;
  border: 1px solid #dbeafe;
}
.chip-icon svg {
  width: 14px;
  height: 14px;
}

.limit-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  color: #64748b;
  font-size: 13px;
}

.limit-controls select,
.limit-controls input {
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 0 10px;
  min-width: 110px;
}

.limit-controls input {
  width: 110px;
}

.limit-controls select:focus,
.limit-controls input:focus {
  outline: none;
  border-color: #9abcf5;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.progress-wrap {
  margin-top: 12px;
}

.progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #eff3f8;
  border: 1px solid #e3eaf4;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0ea371 0%, #10b981 60%, #34d399 100%);
  transition: width .18s ease;
}

.progress-fill.warn {
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}
.progress-fill.danger {
  background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
}

.progress-meta {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
}

#limitSummary {
  color: #475569;
}

.limit-status {
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 800;
  border: 1px solid transparent;
}
.limit-status.neutral {
  color: #64748b;
  background: #f8fafc;
  border-color: #e2e8f0;
}
.limit-status.ok {
  color: #0a7f63;
  background: #ecfdf5;
  border-color: #bbf7d0;
}
.limit-status.warn {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}
.limit-status.danger {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

/* ========== Keywords ========== */
.keyword-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
}

.keyword-header h4 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.keyword-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.keyword-list {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 38px;
}

.keyword-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 8px 10px;
  background: #f8fbff;
  border: 1px solid #dfeafb;
  color: #1e3a8a;
  font-weight: 700;
  font-size: 13px;
}

.keyword-chip .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #cfe0fb;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}

.empty-chip {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  font-weight: 600;
}

/* ========== Guide ========== */
.guide-card {
  background: rgba(255,255,255,0.90);
  border: 1px solid rgba(230,235,242,0.7);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.guide-header {
  margin-bottom: 12px;
}

.guide-header h2 {
  margin: 0;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
}
.guide-header-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid #dbeafe;
}
.guide-header-icon svg {
  width: 20px;
  height: 20px;
}
.guide-header p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.guide-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0,1fr));
}

.guide-item {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 13px;
}

.guide-item-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 6px;
}

.mini-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #0ea371;
  background: #eefdf6;
  border: 1px solid #d4f8e9;
}
.mini-icon svg {
  width: 14px;
  height: 14px;
}

.guide-item p {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.65;
}

.accent-text {
  color: #0a7f63;
  font-weight: 800;
  background: linear-gradient(180deg, rgba(16,185,129,.0) 55%, rgba(16,185,129,.16) 55%);
  padding: 0 2px;
}

/* Notice */
.notice-box {
  margin-top: 12px;
  border-radius: 14px;
  border: 1px solid #fde68a;
  background: linear-gradient(180deg, #fffdf5 0%, #fff9e8 100%);
  padding: 12px;
}

.notice-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #92400e;
  font-weight: 800;
  margin-bottom: 8px;
}

.notice-box .mini-icon {
  color: #b45309;
  background: #fff7ed;
  border-color: #fed7aa;
}

.notice-box ul {
  margin: 0;
  padding-left: 18px;
  color: #7c2d12;
}
.notice-box li {
  margin: 6px 0;
  line-height: 1.6;
  font-size: 13px;
}

/* ========== Toast ========== */
.toast-wrap {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  background: #111827;
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 14px 26px rgba(17, 24, 39, 0.28);
  border: 1px solid rgba(255,255,255,0.08);
  opacity: 0;
  transform: translateY(8px);
  animation: toast-in .2s ease forwards;
  font-size: 13px;
  line-height: 1.45;
}

.toast.success {
  background: #0f172a;
}
.toast.warn {
  background: #78350f;
}
.toast.error {
  background: #7f1d1d;
}

@keyframes toast-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== Modal ========== */
.modal-overlay[hidden] {
  display: none !important;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}

.modal-box {
  width: min(460px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  text-align: center;
}

.modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #dbeafe;
}
.modal-icon svg {
  width: 28px;
  height: 28px;
}

.modal-box h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.modal-box p {
  margin: 8px 0 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.6;
}

.modal-link-preview {
  margin-top: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  padding: 10px 12px;
  color: #0f172a;
  font-weight: 700;
  font-size: 13px;
  word-break: break-all;
}

.modal-actions {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

/* ========== Responsive ========== */
@media (max-width: 1080px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0,1fr));
  }
}

@media (max-width: 768px) {
  .zzoa-wrap {
    width: calc(100% - 16px);
    margin: 10px auto 24px;
    gap: 12px;
  }

  .hero-content {
    padding: 20px 14px 18px;
  }

  .hero-content h1 {
    font-size: 28px;
  }

  .hero-content p {
    font-size: 14px;
  }

  .tool-card,
  .guide-card {
    padding: 12px;
    border-radius: 18px;
  }

  .input-panel,
  .result-panel {
    padding: 10px;
    border-radius: 14px;
  }

  .text-input {
    min-height: 180px;
    padding: 13px;
    border-radius: 12px;
    font-size: 14px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 8px;
  }

  .stat-card {
    min-height: 116px;
    padding: 10px 8px;
  }

  .stat-label {
    min-height: 30px;
    font-size: 11px;
  }

  .stat-value {
    font-size: 22px;
  }

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

  .action-group,
  .tool-top-actions {
    width: 100%;
  }

  .action-group .btn,
  .tool-top-actions .icon-btn {
    flex: 1;
    justify-content: center;
  }

  .input-toolbar {
    align-items: stretch;
  }

  .toggle-group {
    width: 100%;
  }

  .toggle-chip {
    width: 100%;
    justify-content: flex-start;
  }

  .limit-controls {
    width: 100%;
  }

  .limit-controls select,
  .limit-controls input {
    flex: 1;
    min-width: 0;
  }

  .toast-wrap {
    right: 10px;
    left: 10px;
    bottom: 10px;
  }

  .toast {
    min-width: 0;
    max-width: none;
    width: 100%;
  }
}