:root {
  --bg: #fdf8f4;
  --card: #ffffff;
  --primary: #d97757;
  --primary-hover: #c46a4f;
  --text: #1f1c1b;
  --muted: #6b6360;
  --border: #ece4dd;
  --accent: #f4ebe4;
  --error: #c0392b;
  --success: #2c8a4a;
  --shadow: 0 1px 3px rgba(40, 30, 20, 0.06), 0 4px 12px rgba(40, 30, 20, 0.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 60px;
  min-height: 100vh;
}

header {
  text-align: center;
  margin: 24px 0 20px;
}

header h1 {
  font-size: 26px;
  margin: 0 0 6px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

header .subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}

input[type="password"], textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: #fdfbf9;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="password"]:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.15);
}

button {
  display: block;
  width: 100%;
  padding: 14px 18px;
  border-radius: 10px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
  margin-top: 12px;
}

button:active { transform: scale(0.98); }

button.primary {
  background: var(--primary);
  color: #fff;
}
button.primary:hover { background: var(--primary-hover); }
button.primary:disabled { background: #d4cbc4; cursor: not-allowed; }

button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
button.ghost:hover { background: var(--accent); color: var(--text); }

.status {
  text-align: center;
  padding: 20px 16px;
  color: var(--muted);
  font-size: 14px;
}
.status.error { color: var(--error); }

.hint {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 0;
}

.result .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  background: var(--accent);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.note {
  font-size: 13px;
  color: var(--muted);
}

.draft {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.draft-style {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.draft-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 12px;
}

.draft button.copy-btn {
  background: var(--accent);
  color: var(--primary);
  margin: 0;
  padding: 10px 14px;
  font-size: 14px;
}
.draft button.copy-btn.copied {
  background: var(--success);
  color: #fff;
}

footer {
  margin-top: 30px;
  text-align: center;
}
.footer-text {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.hidden { display: none !important; }

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
