:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-glass-dark: rgba(255, 255, 255, 0.95);
  --sidebar-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

#sidebar {
  position: fixed; left: 0; top: 0; width: 280px; height: 100vh;
  background: var(--sidebar-bg); z-index: 1000;
  transform: translateX(-100%); transition: var(--transition);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); backdrop-filter: blur(20px);
}
#sidebar.open { transform: translateX(0); }

.sidebar-logo { padding: 2rem 1.5rem 1.5rem; color: white; border-bottom: 1px solid rgba(255,255,255,0.1); }
.brand { font-family: 'Space Grotesk', sans-serif; font-size: 1.75rem; font-weight: 700; margin-bottom: 0.25rem; }
.brand span { background: linear-gradient(135deg, #fff 0%, #e2e8f0 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.tagline { font-size: 0.875rem; opacity: 0.9; font-weight: 400; }
.sidebar-section-label { padding: 1rem 1.5rem 0.5rem; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(255,255,255,0.7); }

.nav-item {
  display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.875rem 1.5rem;
  background: none; border: none; color: rgba(255,255,255,0.9); font-size: 0.95rem;
  font-weight: 500; cursor: pointer; transition: var(--transition); border-radius: 0 0 0 var(--radius);
}
.nav-item:hover { background: rgba(255,255,255,0.1); color: white; transform: translateX(4px); }
.nav-item.active { background: rgba(255,255,255,0.2); color: white; position: relative; }
.nav-item.active::before { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 4px; background: rgba(255,255,255,0.5); border-radius: 0 var(--radius) 0 0; }
.sidebar-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 1rem 0; }

.hamburger {
  position: fixed; top: 1rem; left: 1rem; z-index: 1001; background: var(--sidebar-bg);
  border: none; width: 48px; height: 48px; border-radius: var(--radius); color: white;
  font-size: 1.25rem; cursor: pointer; box-shadow: var(--shadow-lg); transition: var(--transition);
}
.hamburger:hover { transform: scale(1.05); }
.sidebar-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 999; opacity: 0; visibility: hidden; transition: var(--transition); }
.sidebar-overlay.visible { opacity: 1; visibility: visible; }

/* FOOTER & LAYOUT FIX */
#main {
  flex: 1; margin-left: 0; transition: var(--transition);
  display: flex; flex-direction: column; min-height: 100vh;
  padding-top: 72px; padding-left: 1rem; padding-right: 1rem;
}
@media (min-width: 1024px) { #main { margin-left: 280px; padding-left: 2rem; padding-right: 2rem; } .hamburger { display: none; } #sidebar { transform: translateX(0); position: relative; } }

.site-footer { background: #ffffff; color: #64748b; padding: 3.5rem 1.5rem; border-top: 1px solid #e2e8f0; margin-top: auto; text-align: center; }
.footer-brand { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.4rem; color: #1e293b; margin-bottom: 0.5rem; }
.footer-links { margin: 1.2rem 0; }
.footer-links a { color: #3b82f6; text-decoration: none; font-weight: 500; }
.footer-links .dot { margin: 0 10px; color: #cbd5e1; }
.footer-copyright { font-size: 0.85rem; opacity: 0.7; }

#topbar {
  position: fixed; top: 0; left: 60px; right: 1rem; height: 72px; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; padding: 0 1rem;
  background: var(--bg-glass); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
@media (min-width: 1024px) { #topbar { left: 320px; } }
.topbar-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.5rem; font-weight: 600; }
.privacy-pill { background: linear-gradient(135deg, var(--success), #059669); color: white; padding: 0.5rem 1rem; border-radius: 9999px; font-size: 0.8rem; font-weight: 500; }

#content-area { flex: 1; max-width: 1400px; margin: 0 auto; padding: 2rem 0; }
.panel { display: none; animation: fadeIn 0.4s ease-out; }
.panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.panel-header { text-align: center; margin-bottom: 3rem; max-width: 800px; margin-left: auto; margin-right: auto; }
.panel-header h1 { font-family: 'Space Grotesk', sans-serif; font-size: clamp(2.25rem, 5vw, 3.5rem); font-weight: 700; background: linear-gradient(135deg, var(--text-primary), var(--text-secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 1rem; line-height: 1.1; }
.panel-header p { color: var(--text-secondary); font-size: 1.2rem; }

.hero-badge-row { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-bottom: 4rem; }
.hero-badge { background: var(--bg-glass); backdrop-filter: blur(10px); padding: 0.75rem 1.25rem; border-radius: var(--radius); font-size: 0.875rem; font-weight: 500; border: 1px solid var(--border); }
.hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; max-width: 1200px; margin: 0 auto; }
.tool-card { background: var(--bg-glass); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem 2rem; text-align: center; cursor: pointer; transition: var(--transition); position: relative; overflow: hidden; }
.tool-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.tool-card-icon { font-size: 3rem; margin-bottom: 1rem; display: block; }
.tool-card-name { font-family: 'Space Grotesk', sans-serif; font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; }
.tool-card-desc { color: var(--text-secondary); font-size: 1rem; }

.card { background: var(--bg-glass); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem; box-shadow: var(--shadow-md); max-width: 600px; margin: 0 auto 2rem; }
.form-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.form-label { font-weight: 500; min-width: 80px; }
.form-input { flex: 1; min-width: 200px; padding: 0.875rem 1rem; border: 2px solid var(--border); border-radius: var(--radius); font-size: 1rem; background: var(--bg-glass); }
.form-input:focus { outline: none; border-color: var(--accent); }
.form-input--wide { min-width: 100%; }

/* MOBILE SELECTION ACCESSIBILITY */
.drop-zone { border: 3px dashed var(--border); border-radius: var(--radius); padding: 4rem 2rem; text-align: center; transition: var(--transition); margin-bottom: 2rem; position: relative; overflow: hidden; }
.drop-zone input[type=file] { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; }
.drop-zone:hover { border-color: var(--accent); background: rgba(59, 130, 246, 0.05); }
.drop-zone-icon { font-size: 4rem; margin-bottom: 1rem; display: block; }
.drop-zone-label { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; }
.drop-zone-sub { color: var(--text-secondary); font-size: 0.95rem; }

.file-list { list-style: none; margin-bottom: 2rem; }
.file-list li { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: var(--bg-glass); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.75rem; }
.rm { background: var(--error); color: white; border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }
.fn { flex: 1; font-weight: 500; } .fs { color: var(--text-secondary); font-size: 0.875rem; }

.file-info-bar { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: rgba(59,130,246,0.1); border: 1px solid var(--accent); border-radius: var(--radius); margin-bottom: 2rem; display: none; }
.file-info-bar.visible { display: flex; }
.file-remove { background: var(--error); color: white; border: none; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; }

.progress-wrap { margin: 2rem 0; display: none; }
.progress-wrap.visible { display: block; }
.progress-bar-track { height: 8px; background: var(--border); border-radius: 9999px; overflow: hidden; margin-bottom: 0.5rem; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--success)); width: 0; transition: width 0.4s ease; }

.btn-primary { background: linear-gradient(135deg, var(--accent), #2563eb); color: white; border: none; padding: 1rem 2rem; border-radius: var(--radius); font-size: 1rem; font-weight: 600; cursor: pointer; width: 100%; transition: var(--transition); box-shadow: var(--shadow-md); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

#toast { position: fixed; bottom: 2rem; right: 2rem; background: var(--text-primary); color: white; padding: 1rem 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow-lg); transform: translateX(400px); opacity: 0; transition: var(--transition); z-index: 2000; font-weight: 500; }
#toast.show { transform: translateX(0); opacity: 1; }
#toast.success { background: linear-gradient(135deg, var(--success), #059669); }
#toast.error { background: linear-gradient(135deg, var(--error), #dc2626); }

.privacy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 2rem; margin-top: 3rem; }
.privacy-item { background: var(--bg-glass); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; margin-top: 3rem; }
@media (max-width: 768px) { .contact-grid, .privacy-grid { grid-template-columns: 1fr; } }
.option-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.option-pill { padding: 0.5rem 1rem; border: 2px solid var(--border); border-radius: 9999px; cursor: pointer; font-size: 0.875rem; font-weight: 500; }
.option-pill.selected { background: var(--accent); color: white; border-color: var(--accent); }
.editor-launch-card { text-align: center; min-height: 400px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.editor-launch-icon { font-size: 6rem; margin-bottom: 2rem; }