:root {
  --bg:       #0d0b14;
  --surface:  #15102a;
  --surface2: #1c1535;
  --border:   #3d2b6b;
  --border2:  #3a2960;
  --accent:   #a87dff;
  --accent2:  #7c55d4;
  --accent3:  #7dcc5a;
  --green-bg: #162212;
  --red:      #f87171;
  --txt:      #e0d4ff;
  --muted:    #6b5e8a;
  --muted2:   #5c4e7a;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

body {
  background: var(--bg);
  color: var(--txt);
  font-family: 'Syne', 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: -150px; left: 50%; transform: translateX(-50%);
  width: 800px; height: 800px;
  background: radial-gradient(ellipse at center, #3b1d7a22 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* grid bg */
body::after {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(168,125,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168,125,255,.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.blob1, .blob2 { display: none; }

.container {
  position: relative; z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 20px 64px;
}

/* ── Header ── */
header { text-align: center; margin-bottom: 48px; padding-top: 8px; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #2a1650, #7c55d4);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  border: 1px solid var(--border);
}
.logo-text {
  font-size: 22px; font-weight: 800; letter-spacing: -.5px;
  background: linear-gradient(90deg, var(--txt), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800; line-height: 1.1; letter-spacing: -2px; margin-bottom: 14px;
}
h1 span {
  background: linear-gradient(135deg, var(--accent), #d4a8ff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.subtitle { color: var(--muted); font-size: .95rem; }

/* ── Tabs ── */
.tabs {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 6px;
  margin-bottom: 28px;
  gap: 6px;
}
.tab {
  flex: 1; padding: 13px 16px;
  border: none; border-radius: 12px;
  background: transparent; color: var(--muted);
  font-family: 'Syne', sans-serif; font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  white-space: nowrap;
}
.tab:hover { color: var(--txt); }
.tab.active {
  background: var(--accent2); color: #fff;
  box-shadow: 0 4px 20px rgba(124,85,212,.4);
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 36px;
  position: relative; overflow: hidden;
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent2), transparent);
}

/* ── Dropzone ── */
.dropzone {
  border: 2px dashed var(--border2);
  border-radius: 16px;
  padding: 48px 36px;
  text-align: center; cursor: pointer;
  transition: all .25s;
  position: relative;
  background: var(--surface2);
  margin-bottom: 24px;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent2);
  background: rgba(168,125,255,.05);
}
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dropzone-icon { font-size: 44px; margin-bottom: 14px; display: block; }
.dropzone h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; color: var(--txt); }
.dropzone p  { color: var(--muted); font-size: .84rem; }
.file-type-badge {
  display: inline-block; margin-top: 12px;
  padding: 4px 13px; border-radius: 20px;
  font-size: .72rem; font-weight: 600; font-family: 'DM Mono', monospace;
}
.badge-pdf  { background: rgba(248,113,113,.1); color: #fca5a5; border: 1px solid rgba(248,113,113,.25); }
.badge-blue { background: rgba(168,125,255,.12); color: var(--accent); border: 1px solid rgba(168,125,255,.3); }
.file-selected { background: rgba(168,125,255,.07); border-color: var(--accent2); border-style: solid; }

/* ── Options ── */
.options-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 12px; margin-bottom: 24px;
}
@media (max-width: 640px) { .options-grid { grid-template-columns: 1fr; } }

.option-box {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 12px; padding: 14px 16px;
}
.option-box label {
  display: block; font-size: .68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted2); margin-bottom: 10px;
}
.fmt-toggle { display: flex; gap: 6px; margin-top: 2px; }
.fmt-btn {
  flex: 1; padding: 8px 0;
  border: 1px solid var(--border); border-radius: 8px;
  background: transparent; color: var(--muted);
  font-family: 'DM Mono', monospace; font-size: .8rem;
  cursor: pointer; transition: all .15s; font-weight: 500;
}
.fmt-btn.active { background: var(--accent2); border-color: var(--accent2); color: #fff; }

.range-val { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.range-val .val-label { font-family: 'DM Mono', monospace; font-size: .88rem; color: var(--accent); font-weight: 500; }
input[type="range"] { -webkit-appearance: none; width: 100%; height: 4px; background: var(--border); border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--accent2); cursor: pointer; box-shadow: 0 0 10px rgba(124,85,212,.5); }

.dpi-presets { display: flex; gap: 5px; margin-top: 8px; }
.dpi-preset {
  padding: 4px 8px; border: 1px solid var(--border2); border-radius: 6px;
  background: transparent; color: var(--muted);
  font-family: 'DM Mono', monospace; font-size: .7rem; cursor: pointer; transition: all .15s;
}
.dpi-preset:hover { border-color: var(--accent2); color: var(--txt); }
.dpi-preset.active { background: rgba(124,85,212,.2); border-color: var(--accent2); color: var(--accent); }

/* ── Tip ── */
.tip-box {
  background: rgba(168,125,255,.07);
  border: 1px solid rgba(168,125,255,.2);
  border-radius: 10px; padding: 11px 14px;
  margin-bottom: 20px; font-size: .79rem; color: var(--muted);
  display: flex; gap: 9px; align-items: flex-start;
}
.tip-box strong { color: var(--txt); }

/* ── Convert button ── */
.btn-convert {
  width: 100%; padding: 16px 32px;
  border: none; border-radius: 12px;
  background: var(--accent2);
  color: #fff;
  font-family: 'Syne', sans-serif; font-size: .95rem; font-weight: 700;
  letter-spacing: .5px; cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  position: relative; overflow: hidden;
}
.btn-convert::before {
  content: ''; position: absolute; inset: 0;
  background: var(--accent); opacity: 0; transition: opacity .2s;
}
.btn-convert:hover::before { opacity: 1; }
.btn-convert:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(124,85,212,.45); }
.btn-convert:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.btn-convert span { position: relative; z-index: 1; }

/* ── Progress ── */
.progress-wrap { display: none; margin-top: 20px; }
.progress-wrap.show { display: block; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: .82rem; }
.progress-label .status { color: var(--muted); }
.progress-label .pct { color: var(--accent); font-family: 'DM Mono', monospace; }
.progress-bar-bg { background: var(--bg); border-radius: 4px; height: 5px; overflow: hidden; border: 1px solid var(--border); }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 4px; transition: width .3s ease; width: 0%; }

/* ── Result ── */
.result-box { display: none; margin-top: 20px; background: rgba(125,204,90,.07); border: 1px solid rgba(125,204,90,.2); border-radius: 12px; padding: 16px 20px; align-items: center; gap: 12px; }
.result-box.show { display: flex; }
.result-info { flex: 1; }
.result-info h4 { font-size: .9rem; font-weight: 700; color: var(--accent3); margin-bottom: 2px; }
.result-info p  { font-size: .78rem; color: var(--muted); }
.btn-download {
  padding: 10px 18px;
  background: var(--green-bg); color: var(--accent3);
  border: 1px solid rgba(125,204,90,.3);
  border-radius: 8px;
  font-family: 'Syne', sans-serif; font-size: .83rem; font-weight: 700;
  cursor: pointer; transition: all .2s; white-space: nowrap;
}
.btn-download:hover { background: #1e2e14; border-color: var(--accent3); }

/* ── Error ── */
.error-box { display: none; margin-top: 20px; background: rgba(248,113,113,.07); border: 1px solid rgba(248,113,113,.22); border-radius: 12px; padding: 14px 18px; color: #fca5a5; font-size: .84rem; font-weight: 500; }
.error-box.show { display: block; }

/* ── Info chips ── */
.info-chips { display: flex; gap: 8px; margin-top: 32px; flex-wrap: wrap; justify-content: center; }
.chip {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; font-size: .76rem; color: var(--muted); font-weight: 500;
}
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent3); }

/* ── Notice (Word→PDF) ── */
.notice-box {
  background: rgba(248,113,113,.06); border: 1px solid rgba(248,113,113,.18);
  border-radius: 14px; padding: 30px; text-align: center;
}
.notice-box .notice-icon { font-size: 40px; margin-bottom: 14px; }
.notice-box h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; color: #fca5a5; }
.notice-box p { color: var(--muted); font-size: .83rem; line-height: 1.65; }
.notice-box a { color: var(--accent); text-decoration: none; font-weight: 600; }
.notice-box a:hover { text-decoration: underline; }

.panel { display: none; } .panel.active { display: block; }
