/* TextFloat — โปรแกรมแก้ไขวรรณยุกต์ลอย · โหมดมืดตาม html[data-site-theme="dark"] ของเว็บ */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;700&display=swap');

.tf-main {
  --tf-card: var(--card-bg, #fff);
  --tf-input: var(--input-bg, #f8f9fa);
  --tf-border: var(--border-color, #e5e7eb);
  --tf-text: var(--text-primary, #171717);
  --tf-muted: var(--text-secondary, #525252);
  --tf-input-text: #b45309;
  --tf-ok: #16a34a;
  --tf-reset: #b91c1c;
  min-height: 60vh;
}

html[data-site-theme="dark"] .tf-main {
  --tf-input-text: #ffd905;
  --tf-ok: #4caf50;
  --tf-reset: #af4c4c;
}

.tf-title {
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 600;
  color: var(--tf-text);
  margin-bottom: .5rem;
}

.tf-lead {
  color: var(--tf-muted);
  font-size: .95rem;
}

.tf-card {
  background: var(--tf-card);
  border: 1px solid var(--tf-border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-neumorphic, 0 1px 3px rgba(0, 0, 0, .08));
}

.tf-group {
  margin-bottom: 15px;
}

.tf-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--tf-text);
}

.tf-group textarea {
  font-family: 'Sarabun', sans-serif;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--tf-border);
  border-radius: 8px;
  box-sizing: border-box;
  resize: none;
  background: var(--tf-input);
  color: var(--tf-text);
  font-size: 16px;
  cursor: default;
}

.tf-group textarea:focus {
  outline: none;
  border-color: var(--primary-blue, #2563eb);
}

.tf-group textarea.tf-input {
  color: var(--tf-input-text);
  cursor: text;
}

.tf-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.tf-label-row label {
  display: flex;
  align-items: center;
  margin-bottom: 0;
}

.tf-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--primary-blue, #2563eb);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.tf-link-btn {
  background: none;
  border: none;
  padding: 4px 6px;
  color: var(--tf-muted);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.tf-link-btn:hover {
  color: var(--tf-text);
  text-decoration: underline;
}

.tf-btn-main {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-bottom: 12px;
  border: none;
  border-radius: 10px;
  background: var(--primary-blue, #2563eb);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .1s;
}

.tf-btn-main:hover { filter: brightness(1.08); }
.tf-btn-main:active { transform: scale(.98); }
.tf-btn-main.is-done { background: var(--tf-ok); }

.tf-status {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 15px;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 500;
}

.tf-status[hidden] { display: none; }
.tf-status.is-warn { background: rgba(217, 119, 6, .12); color: #b45309; }
.tf-status.is-error { background: rgba(185, 28, 28, .1); color: var(--tf-reset); }
html[data-site-theme="dark"] .tf-status.is-warn { color: #fbbf24; }
html[data-site-theme="dark"] .tf-status.is-error { color: #f87171; }

.tf-group textarea.tf-output {
  transition: border-color .2s, box-shadow .2s;
}

.tf-group textarea.tf-output.is-copied {
  border-color: var(--tf-ok);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .2);
}

.tf-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 1080;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--tf-ok);
  color: #fff;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity .25s, transform .25s;
}

.tf-toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.tf-credit {
  color: var(--text-muted, #a3a3a3);
  font-size: 13px;
}
