/* ── Toolzng Global ── */
:root {
  --bg:       #ffffff;
  --surface:  #f7f7f7;
  --surface2: #efefef;
  --border:   #e3e3e3;
  --text:     #0d0d0d;
  --muted:    #737373;
  --accent:   #1469FF;
  --accent-h: #0050e0;
  --green:    #16a34a;
  --red:      #dc2626;
  --yellow:   #ca8a04;
  --dark:     #111111;
  --font:     'DM Sans', sans-serif;
  --display:  'Outfit', sans-serif;
  --mono:     'IBM Plex Mono', monospace;
  --radius:   10px;
  --shadow:   0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg:0 8px 40px rgba(0,0,0,0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ── HEADER ── */
header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.logo {
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  color: var(--text);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 0.85rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

.nav-link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.nav-link:hover { color: var(--text); background: var(--surface); }

.coming {
  font-size: 0.58rem;
  font-family: var(--mono);
  background: var(--surface2);
  color: var(--muted);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.header-flag { font-size: 1.1rem; }

/* ── BUTTONS ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #fff;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1.4rem;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
}
.btn-primary:hover { background: var(--accent-h); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary.sm { font-size: 0.82rem; padding: 0.5rem 1.2rem; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  color: var(--text);
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1.4rem;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-secondary:hover { border-color: var(--text); background: var(--surface); }

.cta-btn {
  display: inline-flex;
  align-items: center;
  background: var(--accent);
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.5rem 1.2rem;
  border-radius: 100px;
  transition: background 0.15s;
}
.cta-btn:hover { background: var(--accent-h); }

/* ── HERO ── */
.hero {
  background: var(--bg);
  padding: 5.5rem 2rem 5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: 760px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(20, 105, 255, 0.08);
  border: 1px solid rgba(20, 105, 255, 0.2);
  padding: 0.35rem 1rem;
  border-radius: 100px;
  margin-bottom: 1.75rem;
  letter-spacing: 0.01em;
}

.hero-title {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 1.4rem;
}

.hero-accent { color: var(--accent); }

.hero-desc {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.75;
  max-width: 580px;
  margin: 0 auto 2.25rem;
}

.hero-btns {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2.25rem;
  flex-wrap: wrap;
}

.hero-proof {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.hero-proof span { display: flex; align-items: center; gap: 0.3rem; }

/* ── FEATURES ── */
.features {
  background: var(--surface);
  padding: 4rem 2rem;
  border-bottom: 1px solid var(--border);
}

.features-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: box-shadow 0.2s, transform 0.2s;
}
.feature-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.feature-icon { font-size: 1.75rem; margin-bottom: 1rem; }

.feature-card h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.feature-card p { font-size: 0.85rem; color: var(--muted); line-height: 1.65; }

/* ── APP SECTION ── */
.app-section {
  padding: 3.5rem 2rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.app-section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.app-section-header h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.9rem;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
}

.app-section-header p {
  font-size: 0.9rem;
  color: var(--muted);
}

/* ── WORKSPACE ── */
.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* ── PANEL ── */
.panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.panel-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-num {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
  background: var(--surface2);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.panel-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: -0.01em;
}

/* ── TABS ── */
.tabs {
  display: flex;
  background: var(--surface2);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.tab {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.3rem 0.85rem;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.15s;
}
.tab.active { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.tab:not(.active):hover { color: var(--text); }

/* ── TAB CONTENT ── */
.tab-content { display: none; flex: 1; flex-direction: column; }
.tab-content.active { display: flex; }

/* ── TEXTAREA ── */
textarea {
  flex: 1;
  width: 100%;
  min-height: 380px;
  padding: 1.25rem 1.5rem;
  background: var(--bg);
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.77rem;
  line-height: 1.8;
  resize: none;
  outline: none;
  transition: background 0.15s;
}
textarea:focus { background: #fafbff; }
textarea::placeholder { color: #c0c0c0; }

.textarea-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1.25rem;
}

.char-count { font-family: var(--mono); font-size: 0.62rem; color: var(--muted); }

.link-btn {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: background 0.15s;
}
.link-btn:hover { background: rgba(20,105,255,0.06); }

/* ── DROPZONE ── */
.dropzone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border-bottom: 1px solid var(--border);
  min-height: 300px;
  transition: background 0.15s;
}
.dropzone.dragover { background: rgba(20,105,255,0.04); }

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  text-align: center;
}

.dropzone-icon { color: var(--muted); opacity: 0.5; }
.dropzone-title { font-weight: 600; font-size: 0.95rem; }
.dropzone-sub { font-size: 0.8rem; color: var(--muted); }
.dropzone-hint { font-family: var(--mono); font-size: 0.62rem; color: var(--muted); }

.file-name {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 500;
}

/* ── FORMAT BUTTON ── */
.format-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: -0.01em;
}
.format-btn:hover { background: var(--accent-h); }
.format-btn:disabled { background: var(--surface2); color: var(--muted); cursor: not-allowed; }
.format-btn-arrow { font-size: 1rem; transition: transform 0.2s; }
.format-btn:hover .format-btn-arrow { transform: translateX(4px); }

/* ── DOWNLOAD BUTTON ── */
.btn-download {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-download:hover:not(:disabled) { opacity: 0.82; }
.btn-download:disabled { background: var(--surface2); color: var(--muted); cursor: not-allowed; }

/* ── PREVIEW ── */
.preview-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  min-height: 380px;
}

.preview-placeholder {
  height: 100%;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.placeholder-lines { display: flex; flex-direction: column; gap: 0.7rem; width: 180px; }
.ph-line { height: 8px; background: var(--surface2); border-radius: 4px; }
.w45 { width: 45%; } .w55 { width: 55%; } .w65 { width: 65%; }
.w75 { width: 75%; } .w80 { width: 80%; } .w85 { width: 85%; }

.preview-placeholder p {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

/* ── DOCUMENT ── */
.preview-doc {
  font-family: 'Times New Roman', Times, serif;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 2;
}

.doc-heading { font-weight: bold; text-align: justify; margin: 1.2em 0 0.4em; }
.doc-paragraph { text-align: justify; text-indent: 2em; }
.doc-reference { text-align: justify; padding-left: 2em; text-indent: -2em; margin-bottom: 0.3em; }
.doc-reference em, .doc-paragraph em { font-style: italic; }

.doi-link {
  font-family: var(--mono);
  font-size: 0.68em;
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}
.doi-link:hover { text-decoration: underline; }

.doi-badge {
  font-family: var(--mono);
  font-size: 0.6em;
  padding: 0.15em 0.5em;
  border-radius: 100px;
  font-weight: 600;
  white-space: nowrap;
}
.doi-badge.verified   { background: #dcfce7; color: var(--green); }
.doi-badge.unverified { background: #fef9c3; color: var(--yellow); }
.doi-badge.not-found  { background: #fee2e2; color: var(--red); }

/* ── DOI BAR ── */
.doi-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-wrap: wrap;
}

.doi-bar-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.doi-pill-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ── LOADING ── */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(4px);
  z-index: 300;
  align-items: center;
  justify-content: center;
}
.loading-overlay.show { display: flex; }

.loader-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-lg);
  min-width: 240px;
}

.loader-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loader-step {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--mono);
  text-align: center;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--dark);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0.7rem 1.5rem;
  border-radius: 100px;
  transition: transform 0.25s ease;
  z-index: 400;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}
.toast.show  { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }

/* ── FOOTER ── */
footer {
  background: var(--dark);
  color: rgba(255,255,255,0.85);
  padding: 4rem 2rem 0;
  margin-top: 0;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-logo {
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 0.85rem;
}

.footer-tagline {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.65;
  margin-bottom: 1rem;
  max-width: 260px;
}

.footer-flag { font-size: 0.8rem; color: rgba(255,255,255,0.4); }

.footer-col h4 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.82rem;
  color: #fff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}

.footer-col a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  padding: 0.3rem 0;
  transition: color 0.15s;
}
.footer-col a:hover { color: #fff; }

.coming-soon-tag {
  font-family: var(--mono);
  font-size: 0.58rem;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 0;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  font-family: var(--mono);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .features-inner { grid-template-columns: repeat(2, 1fr); }
  .workspace { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .hero-title { font-size: 2.4rem; }
  .main-nav { display: none; }
  .features-inner { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; }
  .hero-proof { gap: 0.75rem; }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
