/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --teal:        #14B8A6;
  --teal-light:  #5EEAD4;
  --teal-dark:   #0D9488;
  --purple:      #8B5CF6;
  --purple-light:#C4B5FD;
  --navy:        #0F172A;
  --slate:       #1E293B;
  --slate-mid:   #334155;
  --muted:       #64748B;
  --border:      #E2E8F0;
  --surface:     #F8FAFC;
  --white:       #FFFFFF;
  --success:     #10B981;
  --radius-sm:   8px;
  --radius-md:   16px;
  --radius-lg:   24px;
  --radius-xl:   32px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:   0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg:   0 20px 60px rgba(0,0,0,.12), 0 8px 20px rgba(0,0,0,.07);
  --transition:  all .25s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: #F0FDFC;
  color: var(--slate);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Animated Background Blobs ── */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  animation: blobFloat 12s ease-in-out infinite;
}
.blob-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #5EEAD4 0%, #14B8A6 100%);
  top: -200px; left: -200px;
  animation-delay: 0s;
}
.blob-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #C4B5FD 0%, #8B5CF6 100%);
  top: 40%; right: -150px;
  animation-delay: -4s;
}
.blob-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #BAE6FD 0%, #38BDF8 100%);
  bottom: -100px; left: 30%;
  animation-delay: -8s;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -20px) scale(1.05); }
  66%       { transform: translate(-20px, 15px) scale(.97); }
}

/* ── Wrapper ── */
.wrapper {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

/* ── Header ── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 48px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(20,184,166,.35);
}
.logo-icon svg { width: 28px; height: 28px; }

.logo-text { display: flex; flex-direction: column; }
.logo-name {
  font-family: 'Sora', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--slate);
  letter-spacing: -.3px;
}
.logo-tagline {
  font-size: .72rem;
  color: var(--muted);
  letter-spacing: .4px;
  text-transform: uppercase;
  margin-top: 1px;
}

.header-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(20,184,166,.1);
  border: 1px solid rgba(20,184,166,.25);
  color: var(--teal-dark);
  font-size: .78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
}
.badge-dot {
  width: 7px; height: 7px;
  background: var(--teal);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(.7); }
}

/* ── Hero ── */
.hero {
  text-align: center;
  margin-bottom: 40px;
}
.hero-title {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--navy);
  margin-bottom: 14px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--teal), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Language Bar ── */
.lang-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 10px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.lang-from .lang-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--slate);
  background: var(--surface);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.swap-arrow {
  color: var(--muted);
  flex-shrink: 0;
}
.swap-arrow svg { width: 18px; height: 18px; display: block; }

.lang-to {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1.5px solid var(--border);
  padding: 7px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.lang-btn:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
  background: rgba(20,184,166,.06);
  transform: translateY(-1px);
}
.lang-btn.active {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  border-color: transparent;
  color: var(--white);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(20,184,166,.35);
}
.lang-btn--soon {
  opacity: .38;
  cursor: not-allowed;
  position: relative;
}
.lang-btn--soon:hover {
  transform: none;
  border-color: var(--border);
  color: var(--muted);
  background: transparent;
}
.lang-btn--soon::after {
  content: 'Coming soon';
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--slate);
  color: var(--white);
  font-size: .7rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease;
}
.lang-btn--soon:hover::after { opacity: 1; }

/* ── Main Panel ── */
.panel {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  align-items: start;
  margin-bottom: 32px;
}

/* ── Box ── */
.box {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: box-shadow .3s ease, border-color .3s ease;
}
.box:focus-within {
  border-color: rgba(20,184,166,.4);
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(20,184,166,.08);
}

.box-input { border-radius: var(--radius-lg) 0 0 var(--radius-lg); border-right: none; }
.box-output { border-radius: 0 var(--radius-lg) var(--radius-lg) 0; border-left: none; }

.box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.box-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.box-label svg { width: 14px; height: 14px; }

.icon-btn {
  width: 30px; height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
  transition: var(--transition);
}
.icon-btn:hover {
  background: var(--surface);
  border-color: var(--border);
  color: var(--slate);
}
.icon-btn svg { width: 15px; height: 15px; }

.output-actions { display: flex; gap: 6px; }

textarea {
  width: 100%;
  min-height: 260px;
  padding: 20px;
  font-family: 'Inter', sans-serif;
  font-size: .95rem;
  line-height: 1.7;
  color: var(--slate);
  background: transparent;
  border: none;
  outline: none;
  resize: vertical;
}
textarea::placeholder { color: #A8B4C0; }

.box-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.char-count { font-size: .78rem; color: var(--muted); }

.sample-btn {
  font-size: .75rem;
  color: var(--teal-dark);
  background: rgba(20,184,166,.08);
  border: 1px solid rgba(20,184,166,.2);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.sample-btn:hover {
  background: rgba(20,184,166,.15);
  transform: translateY(-1px);
}

/* ── Output Text ── */
.output-text {
  min-height: 260px;
  padding: 20px;
  font-size: .95rem;
  line-height: 1.8;
  color: var(--slate);
  position: relative;
}

.output-placeholder {
  height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #A8B4C0;
  font-size: .9rem;
}
.placeholder-icon svg { width: 48px; height: 48px; display: block; }

.output-text.has-content { color: var(--slate); }

.method-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}
.method-badge.gemini {
  color: #7C3AED;
  background: rgba(139,92,246,.1);
  border: 1px solid rgba(139,92,246,.25);
}
.method-badge.google {
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
}

.correction-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-weight: 600;
  color: #0D9488;
  background: rgba(20,184,166,.1);
  border: 1px solid rgba(20,184,166,.25);
  padding: 3px 10px;
  border-radius: 999px;
}
.correction-badge svg { width: 12px; height: 12px; }

.word-count { font-size: .78rem; color: var(--muted); }

/* ── Translate Button Column ── */
.translate-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  padding-top: 60px;
  gap: 10px;
}

.translate-btn {
  position: relative;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 50%, var(--purple) 100%);
  background-size: 200% 200%;
  border: none;
  border-radius: var(--radius-xl);
  padding: 14px 20px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(20,184,166,.4);
  transition: transform .2s ease, box-shadow .2s ease;
  animation: gradientShift 5s ease infinite;
  white-space: nowrap;
}
.translate-btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 14px 32px rgba(20,184,166,.5);
}
.translate-btn:active { transform: translateY(-1px) scale(1.01); }

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}

.btn-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.btn-icon { width: 22px; height: 22px; color: var(--white); display: block; }
.btn-text {
  font-family: 'Sora', sans-serif;
  font-size: .85rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: .3px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.btn-spinner {
  display: none;
  animation: spin .8s linear infinite;
}
.btn-spinner svg { width: 22px; height: 22px; color: var(--white); }
@keyframes spin { to { transform: rotate(360deg); } }

.translate-btn.loading .btn-icon,
.translate-btn.loading .btn-text { display: none; }
.translate-btn.loading .btn-spinner { display: block; }

.keyboard-hint {
  font-size: .68rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}
kbd {
  background: var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: .66rem;
  font-family: monospace;
  border: 1px solid #CBD5E1;
  color: var(--slate-mid);
}

/* ── Refine Toggle Button ── */
.refine-toggle-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .3px;
  text-transform: uppercase;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.refine-toggle-btn svg { width: 16px; height: 16px; }
.refine-toggle-btn:hover {
  border-color: var(--purple-light);
  color: var(--purple);
  background: #FAF5FF;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139,92,246,.15);
}
.refine-toggle-btn.active {
  border-color: var(--purple);
  color: var(--purple);
  background: #FAF5FF;
  box-shadow: 0 4px 12px rgba(139,92,246,.2);
}

/* ── Refine Panel ── */
.refine-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height .45s cubic-bezier(.4,0,.2,1), opacity .3s ease;
  opacity: 0;
  margin-bottom: 0;
}
.refine-panel.open {
  max-height: 700px;
  opacity: 1;
  margin-bottom: 24px;
}

.refine-panel-inner {
  background: var(--white);
  border: 1.5px solid var(--purple-light);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  box-shadow: 0 8px 32px rgba(139,92,246,.1);
  margin-top: 12px;
}

.refine-header { margin-bottom: 22px; }
.refine-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Sora', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--slate);
  margin-bottom: 5px;
}
.refine-title svg { width: 18px; height: 18px; color: var(--purple); }
.refine-subtitle { font-size: .83rem; color: var(--muted); line-height: 1.5; }

.refine-fields { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }

.refine-section-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--purple);
  padding-bottom: 2px;
}
.refine-divider {
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}
.refine-row {}
.refine-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 600px) {
  .refine-row-2col { grid-template-columns: 1fr; }
}

.refine-field {}
.field-label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}

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

.pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: .83rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.pill:hover {
  border-color: var(--purple-light);
  color: var(--purple);
  background: #FAF5FF;
}
.pill.active {
  background: linear-gradient(135deg, var(--purple), #7C3AED);
  border-color: transparent;
  color: var(--white);
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(139,92,246,.35);
}
.pill-sub {
  font-size: .7rem;
  opacity: .75;
  font-weight: 400;
}

/* Pronoun preview strip */
.refine-preview {
  background: #F5F3FF;
  border: 1px solid var(--purple-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 18px;
}
.refine-preview-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 8px;
}
.refine-preview-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.preview-chip {
  background: var(--white);
  border: 1px solid var(--purple-light);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: .8rem;
  color: var(--slate);
}
.preview-chip strong { color: var(--purple); font-weight: 700; }

.refine-apply-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--purple), #7C3AED);
  color: var(--white);
  font-family: 'Sora', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(139,92,246,.35);
  transition: transform .2s ease, box-shadow .2s ease;
  margin-bottom: 10px;
}
.refine-apply-btn svg { width: 16px; height: 16px; }
.refine-apply-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(139,92,246,.45);
}
.refine-apply-btn:active { transform: translateY(0); }
.refine-apply-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.refine-note {
  text-align: center;
  font-size: .72rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Terms Section ── */
.terms-section {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
}

.terms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  cursor: pointer;
  user-select: none;
  transition: background .2s ease;
}
.terms-header:hover { background: var(--surface); }

.terms-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--slate);
}
.terms-title svg { width: 18px; height: 18px; color: var(--teal); }

.terms-toggle-icon {
  font-size: .75rem;
  color: var(--muted);
  transition: transform .3s ease;
}
.terms-toggle-icon.open { transform: rotate(180deg); }

.terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s cubic-bezier(.4,0,.2,1);
}
.terms-grid.open { max-height: 800px; }

.term-card {
  background: var(--white);
  padding: 14px 18px;
  transition: background .2s ease;
}
.term-card:hover { background: #F0FDFC; }
.term-en {
  font-size: .82rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.term-vi {
  font-size: .95rem;
  font-weight: 600;
  color: var(--slate);
}
.term-note {
  font-size: .72rem;
  color: var(--teal-dark);
  margin-top: 2px;
}

/* ── Footer ── */
.footer {
  text-align: center;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.8;
}
.footer-sub { font-size: .75rem; opacity: .75; }
.footer-credit { font-size: .72rem; color: var(--teal-dark); margin-top: 6px; opacity: .7; }

/* ── Disclaimer Modal ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: backdropIn .3s ease;
}
.modal-backdrop.hidden { display: none; }

@keyframes backdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px 32px 28px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 32px 80px rgba(0,0,0,.22), 0 8px 24px rgba(0,0,0,.1);
  animation: modalIn .35s cubic-bezier(.34,1.56,.64,1);
  position: relative;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(24px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 8px 20px rgba(20,184,166,.3);
}
.modal-icon svg { width: 24px; height: 24px; color: white; }

.modal-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 20px;
}

.modal-body { display: flex; flex-direction: column; gap: 16px; margin-bottom: 28px; }

.modal-rule {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.modal-rule strong { display: block; font-size: .9rem; color: var(--slate); margin-bottom: 4px; }
.modal-rule p { font-size: .82rem; color: var(--muted); line-height: 1.55; margin: 0; }

.rule-icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.rule-icon svg { width: 16px; height: 16px; }
.rule-icon--warning { background: #FEF3C7; color: #D97706; }
.rule-icon--info    { background: #EFF6FF; color: #3B82F6; }
.rule-icon--check   { background: #F0FDF4; color: #16A34A; }

.modal-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: white;
  font-family: 'Sora', sans-serif;
  font-size: .95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(20,184,166,.35);
  transition: transform .2s ease, box-shadow .2s ease;
  margin-bottom: 12px;
}
.modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(20,184,166,.45);
}
.modal-btn:active { transform: translateY(0); }

.modal-footer-note {
  text-align: center;
  font-size: .72rem;
  color: var(--muted);
  margin: 0;
}

/* ── Third-party modal ── */
.tp-modal {
  max-height: 90vh;
  overflow-y: auto;
}
.tp-modal .modal-subtitle {
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.5;
  margin: -10px 0 20px;
}
.tp-party-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
}
.tp-party-card:last-child { margin-bottom: 20px; }
.tp-snippet {
  font-size: .78rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.45;
  margin-bottom: 10px;
  background: rgba(139,92,246,.06);
  border-left: 3px solid var(--purple-light);
  padding: 6px 10px;
  border-radius: 0 6px 6px 0;
}
.tp-person-name {
  font-size: .93rem;
  font-weight: 600;
  color: var(--slate);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.tp-role {
  font-size: .73rem;
  font-weight: 400;
  color: var(--muted);
  background: rgba(139,92,246,.1);
  color: var(--purple);
  padding: 2px 8px;
  border-radius: 20px;
}
.tp-field { margin-bottom: 12px; }
.tp-field:last-child { margin-bottom: 0; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--slate);
  color: var(--white);
  font-size: .85rem;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 9999;
  box-shadow: var(--shadow-lg);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Text appear animation ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.output-text.animating { animation: fadeInUp .35s ease forwards; }

/* ── Responsive ── */
@media (max-width: 700px) {
  .panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .box-input  { border-radius: var(--radius-lg); border-right: 1.5px solid var(--border); margin-bottom: 0; }
  .box-output { border-radius: var(--radius-lg); border-left: 1.5px solid var(--border); margin-top: 0; }
  .translate-center {
    flex-direction: row;
    padding: 16px 0;
    justify-content: center;
  }
  .translate-btn { padding: 12px 32px; }
  .btn-inner { flex-direction: row; }
  .btn-text { writing-mode: horizontal-tb; }
  .swap-arrow { display: none; }
  .lang-bar { gap: 10px; }
  .header-badge { display: none; }
}
