/* ══════════════════════════════════════
   KYTHERA TOOLS — Premium Dark Theme
   ══════════════════════════════════════ */

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

:root {
  --bg: #000000;
  --surface: #090B10;
  --surface-2: #0F1219;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --text-primary: #FFFFFF;
  --text-secondary: #A0A0A0;
  --text-muted: #5A5A5A;
  --accent: #57F2C2;
  --accent-dim: rgba(87, 242, 194, 0.1);
  --accent-border: rgba(87, 242, 194, 0.25);
  --purple: #A855F7;
  --purple-dim: rgba(168, 85, 247, 0.1);
  --success: #00E887;
  --success-dim: rgba(0, 232, 135, 0.1);
  --error: #FF4D6A;
  --error-dim: rgba(255, 77, 106, 0.1);
  --info: #40AAFF;
  --info-dim: rgba(64, 170, 255, 0.1);
  --warn: #FFB740;
  --warn-dim: rgba(255, 183, 64, 0.1);
  --glass: rgba(255, 255, 255, 0.03);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 28px;
  --radius-full: 999px;
}

html {
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Ambient Background */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 40% at 20% 10%, rgba(87, 242, 194, 0.04) 0%, transparent 60%);
}

.ambient-2 {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 50% 35% at 80% 80%, rgba(168, 85, 247, 0.03) 0%, transparent 60%);
}

.app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 100px;
  min-height: 100vh;
}

/* ═════════════════════════════════════
   HEADER
   ══════════════════════════════════════ */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  margin: 0 -16px;
  padding: 16px 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  box-shadow: 0 0 20px rgba(87, 242, 194, 0.15);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.logo-sub {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.premium-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #FFD700;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 232, 135, 0.5);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ══════════════════════════════════════
   SECTIONS
   ══════════════════════════════════════ */
.section {
  display: none;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.3s ease;
}

.section.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═════════════════════════════════════
   HERO
   ══════════════════════════════════════ */
.hero {
  text-align: center;
  padding: 8px 0 4px;
}

.hero-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  background: linear-gradient(135deg, #FFFFFF 0%, #A0A0A0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 6px;
  letter-spacing: 0.02em;
}

.hero-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 10px;
  line-height: 1.6;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: center;
}

.btn-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius-full);
  padding: 12px 24px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(87, 242, 194, 0.25);
}

.btn-primary:active {
  transform: scale(0.96);
  box-shadow: 0 2px 12px rgba(87, 242, 194, 0.2);
}

.btn-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 12px 24px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
}

.btn-secondary:active {
  transform: scale(0.96);
  border-color: var(--border-hover);
}

/* ═════════════════════════════════════
   STATS
   ══════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.stat-card:active {
  transform: scale(0.98);
  border-color: var(--border-hover);
}

.stat-icon {
  width: 32px;
  height: 32px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.stat-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
}

.stat-value.stat-accent {
  color: var(--accent);
}

.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ══════════════════════════════════════
   TRUST BADGE
   ══════════════════════════════════════ */
.trust-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--success-dim);
  border: 1px solid rgba(0, 232, 135, 0.15);
  border-radius: var(--radius-full);
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--success);
}

/* ══════════════════════════════════════
   QUICK ACTIONS
   ══════════════════════════════════════ */
.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 12px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
}

.action-btn:active {
  transform: scale(0.96);
  border-color: var(--accent-border);
  background: var(--accent-dim);
}

.action-icon {
  width: 40px;
  height: 40px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: all 0.2s;
}

.action-btn:active .action-icon {
  background: var(--accent-dim);
  border-color: var(--accent-border);
}

/* ══════════════════════════════════════
   VERSION CARD
   ══════════════════════════════════════ */
.version-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.version-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.version-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.version-row:last-child {
  border-bottom: none;
}

.version-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.version-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

#versionVal {
  cursor: pointer;
  user-select: none;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

#versionVal:active {
  background: var(--glass);
}

/* ══════════════════════════════════════
   SECTION HEADER
   ══════════════════════════════════════ */
.section-header {
  text-align: center;
  padding: 4px 0;
}

.section-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.section-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ══════════════════════════════════════
   MODE SELECTOR
   ═════════════════════════════════════ */
.mode-selector {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.mode-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 1px solid var(--border);
  -webkit-tap-highlight-color: transparent;
}

.mode-card:last-child {
  border-bottom: none;
}

.mode-card:active {
  background: rgba(255, 255, 255, 0.02);
}

.mode-card.active {
  background: var(--accent-dim);
  border-left: 3px solid var(--accent);
}

.mode-icon {
  width: 42px;
  height: 42px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: all 0.2s;
}

.mode-card.active .mode-icon {
  background: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--accent);
}

.mode-info {
  flex: 1;
  min-width: 0;
}

.mode-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.mode-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

.mode-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  margin-top: 6px;
  letter-spacing: 0.05em;
}

.badge-cyan {
  background: var(--info-dim);
  color: var(--info);
  border: 1px solid rgba(64, 170, 255, 0.2);
}

.badge-purple {
  background: var(--purple-dim);
  color: var(--purple);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.badge-green {
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid rgba(0, 232, 135, 0.2);
}

/* ══════════════════════════════════════
   ITS PANEL
   ══════════════════════════════════════ */
.its-panel {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.its-panel.show {
  display: block;
}

.panel-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.its-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.its-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.its-item:active {
  transform: scale(0.96);
}

.its-item.selected {
  background: var(--purple-dim);
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.15);
}

.its-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--purple);
}

.its-label {
  font-size: 10px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
}

/* ══════════════════════════════════════
   UPLOAD ZONE
   ═════════════════════════════════════ */
input[type="file"] {
  display: none;
}

.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--accent-dim);
  border: 1.5px dashed var(--accent-border);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.upload-zone:active,
.upload-zone.over {
  background: rgba(87, 242, 194, 0.08);
  border-color: var(--accent);
  transform: scale(0.99);
}

.upload-icon {
  width: 48px;
  height: 48px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.upload-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.upload-hint {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ══════════════════════════════════════
   FILE DISPLAY
   ══════════════════════════════════════ */
.file-display {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text-secondary);
  min-height: 42px;
  word-break: break-all;
  line-height: 1.5;
  transition: all 0.2s;
}

.file-display.ok {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-dim);
}

/* ══════════════════════════════════════
   PREVIEW
   ══════════════════════════════════════ */
.preview-box {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.preview-box video {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  display: none;
  background: #000;
}

.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px;
  color: var(--text-muted);
}

.preview-placeholder svg {
  opacity: 0.3;
}

.preview-placeholder span {
  font-size: 11px;
  opacity: 0.5;
}

/* ══════════════════════════════════════
   STATUS
   ══════════════════════════════════════ */
.status-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 12px;
  color: var(--text-secondary);
  min-height: 46px;
  line-height: 1.6;
  transition: all 0.3s;
}

.status-box.working {
  color: var(--info);
  border-color: rgba(64, 170, 255, 0.25);
  background: var(--info-dim);
}

.status-box.success {
  color: var(--success);
  border-color: rgba(0, 232, 135, 0.25);
  background: var(--success-dim);
}

.status-box.error {
  color: var(--error);
  border-color: rgba(255, 77, 106, 0.25);
  background: var(--error-dim);
}

/* ══════════════════════════════════════
   PROGRESS
   ══════════════════════════════════════ */
.progress-wrap {
  display: none;
}

.progress-wrap.show {
  display: block;
}

.progress-bg {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  height: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #3DD6A8);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  width: 0%;
  box-shadow: 0 0 12px rgba(87, 242, 194, 0.3);
}

.progress-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

.progress-label {
  font-size: 10px;
  color: var(--text-muted);
}

.progress-eta {
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'SF Mono', 'Monaco', monospace;
}

/* ══════════════════════════════════════
   RESULT
   ══════════════════════════════════════ */
.result-card {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.result-card.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.result-icon {
  width: 40px;
  height: 40px;
  background: var(--success-dim);
  border: 1px solid rgba(0, 232, 135, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
  flex-shrink: 0;
}

.result-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--success);
}

.result-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.result-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.result-key {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}

.result-value {
  font-size: 12px;
  font-weight: 600;
  word-break: break-all;
  color: var(--text-primary);
}

.result-value.accent {
  color: var(--accent);
}

/* ══════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════ */
.btn-process {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius-full);
  padding: 16px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 24px rgba(87, 242, 194, 0.25);
  -webkit-tap-highlight-color: transparent;
}

.btn-process:active:not(:disabled) {
  transform: scale(0.97);
  box-shadow: 0 2px 12px rgba(87, 242, 194, 0.2);
}

.btn-process:disabled {
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
  border: 1px solid var(--border);
}

.btn-encoder {
  background: linear-gradient(135deg, var(--purple), #7C3AED);
  color: #fff;
  box-shadow: 0 4px 24px rgba(168, 85, 247, 0.25);
}

.btn-encoder:active:not(:disabled) {
  box-shadow: 0 2px 12px rgba(168, 85, 247, 0.2);
}

/* ══════════════════════════════════════
   WARNING
   ══════════════════════════════════════ */
.warning-card {
  display: flex;
  gap: 12px;
  background: var(--warn-dim);
  border: 1px solid rgba(255, 183, 64, 0.18);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.warning-icon {
  width: 32px;
  height: 32px;
  background: rgba(255, 183, 64, 0.1);
  border: 1px solid rgba(255, 183, 64, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warn);
  flex-shrink: 0;
}

.warning-text {
  flex: 1;
}

.warning-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--warn);
  margin-bottom: 3px;
}

.warning-text p {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ══════════════════════════════════════
   ENCODER PANEL
   ══════════════════════════════════════ */
.encoder-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.encoder-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.encoder-row label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.encoder-select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A0A0A0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
  transition: all 0.2s;
}

.encoder-select:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.encoder-hint {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.5;
}

.encoder-stamp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.encoder-stamp-row span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Toggle */
.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.toggle input:checked ~ .toggle-slider {
  background: var(--accent-dim);
  border-color: var(--accent-border);
}

.toggle input:checked ~ .toggle-slider::before {
  transform: translateX(20px);
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(87, 242, 194, 0.4);
}

/* ══════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.empty-icon {
  width: 64px;
  height: 64px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 280px;
}

/* ══════════════════════════════════════
   SETTINGS
   ══════════════════════════════════════ */
.settings-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-item:active {
  background: rgba(255, 255, 255, 0.02);
}

.setting-info {
  flex: 1;
}

.setting-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.setting-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.setting-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

/* About Card */
.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.about-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.about-row:last-child {
  border-bottom: none;
}

.about-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.about-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Social Grid */
.social-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.social-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.social-item:active {
  background: var(--surface-2);
  transform: scale(0.98);
}

.social-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.social-tt {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.social-ig {
  background: rgba(225, 48, 108, 0.08);
  border: 1px solid rgba(225, 48, 108, 0.2);
  color: #E1306C;
}

.social-tg {
  background: rgba(0, 136, 212, 0.08);
  border: 1px solid rgba(0, 136, 212, 0.2);
  color: #0088D4;
}

.social-info {
  flex: 1;
}

.social-platform {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.social-handle {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ═════════════════════════════════════
   INTERPOLATION LAB
   ══════════════════════════════════════ */
.interp-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--purple-dim);
  border: 1.5px dashed rgba(168, 85, 247, 0.3);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.interp-upload:active {
  background: rgba(168, 85, 247, 0.12);
  border-color: var(--purple);
}

.interp-log {
  background: var(--surface);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 11px;
  font-family: 'SF Mono', 'Monaco', monospace;
  color: var(--text-muted);
  min-height: 80px;
  max-height: 160px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.7;
}

.interp-log .ok { color: var(--success); }
.interp-log .err { color: var(--error); }
.interp-log .inf { color: var(--info); }

/* ══════════════════════════════════════
   BOTTOM NAV
   ══════════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(9, 11, 16, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 2px;
  z-index: 999;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  max-width: calc(100% - 32px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-full);
  padding: 8px 12px;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  min-width: 56px;
}

.nav-item:active {
  transform: scale(0.9);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.nav-item svg {
  width: 18px;
  height: 18px;
}

.nav-item span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ═════════════════════════════════════
   SCROLLBAR
   ══════════════════════════════════════ */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 360px) {
  .hero-title { font-size: 28px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-value { font-size: 18px; }
  .bottom-nav { padding: 5px 6px; }
  .nav-item { padding: 7px 10px; min-width: 50px; }
}
/* ══════════════════════════════════════
   WELCOME OVERLAY & HEADER ICONS (NEW)
   ══════════════════════════════════════ */
.welcome-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: var(--bg); display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s;
}
.welcome-overlay.hidden { opacity: 0; visibility: hidden; }
.welcome-gear {
  width: 60px; height: 60px; color: var(--accent);
  animation: spinGear 2s linear infinite; margin-bottom: 24px;
}
@keyframes spinGear { 100% { transform: rotate(360deg); } }
.welcome-text-1 { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; font-weight: 500; }
.welcome-text-2 { font-size: 22px; color: var(--text-primary); margin-bottom: 8px; font-weight: 800; text-align: center; }
.welcome-text-3 { font-size: 12px; color: var(--accent); letter-spacing: 3px; text-transform: uppercase; font-weight: 700; }

.header-icons { display: flex; gap: 12px; align-items: center; margin-right: 12px; }
.h-icon {
  color: var(--text-secondary); transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.h-icon:active { color: var(--accent); transform: scale(0.9); }
.h-icon.support { color: #A855F7; }
/* ══════════════════════════════════════
   FEATURES, FAQ, FOOTER & DEV BADGE (NEW)
   ══════════════════════════════════════ */
.features-section { margin-top: 35px; }
.features-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px;}
.feature-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; display: flex; align-items: flex-start; gap: 12px; }
.feature-icon { color: var(--accent); background: var(--accent-dim); padding: 8px; border-radius: 8px; flex-shrink: 0; }
.feature-text h4 { font-size: 13px; color: var(--text-primary); margin-bottom: 4px; font-weight: 700;}
.feature-text p { font-size: 11px; color: var(--text-secondary); line-height: 1.5; }

.faq-section { margin-top: 35px; }
.faq-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; margin-top: 10px; }
.faq-q { font-size: 12px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; display: flex; gap: 8px; align-items: flex-start; }
.faq-q svg { color: var(--purple); flex-shrink: 0; margin-top: 2px; }
.faq-a { font-size: 11px; color: var(--text-secondary); line-height: 1.6; padding-left: 22px; }

.site-footer { text-align: center; padding: 40px 10px 30px; margin-top: 20px; }
.site-footer p { font-size: 10px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }

.dev-badge { background: linear-gradient(135deg, rgba(168,85,247,0.1), rgba(87,242,194,0.05)); border: 1px solid var(--accent-border); border-radius: var(--radius-lg); padding: 20px; margin-top: 25px; text-align: center; box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
.dev-badge h4 { font-size: 14px; color: var(--text-primary); margin-bottom: 6px; font-weight: 800; }
.dev-badge p { font-size: 11px; color: var(--text-secondary); line-height: 1.5;}
/* ══════════════════════════════════════
   KYTHERA V6.3 - RESPONSIVE & THEMES 
   ══════════════════════════════════════ */

/* 1. Theme: OLED Black */
[data-theme="oled"] {
  --bg: #000000;
  --surface: #0a0a0a;
  --surface-2: #121212;
  --border: #1a1a1a;
}

/* 2. Reduksi Glow Hijau (Lebih Elegan & Profesional) */
.nav-item.active {
  color: var(--accent);
  text-shadow: 0 0 5px rgba(87, 242, 194, 0.3); /* Glow dihaluskan */
}
.btn-process {
  box-shadow: 0 4px 15px rgba(0, 232, 135, 0.15); /* Glow shadow dihaluskan */
}

/* 3. Smooth Page Transition (Perpindahan Tab) */
.section {
  display: none;
  opacity: 0;
  transform: translateY(12px);
  animation: sectionFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.section.active {
  display: block;
}
@keyframes sectionFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

/* 4. Desktop Navigation Header (Sembunyi di Mobile) */
.desktop-nav { 
  display: none; 
  gap: 25px; 
  align-items: center; 
  margin-left: auto;
  margin-right: 20px;
}
.desktop-nav button { 
  background: none; border: none; color: var(--text-secondary); 
  font-family: inherit; font-size: 14px; font-weight: 600; 
  cursor: pointer; transition: 0.2s; 
}
.desktop-nav button:hover, .desktop-nav button.active { 
  color: var(--accent); 
}

/* ══════════════════════════════════════
   RESPONSIVE LAYOUT (TABLET & DESKTOP)
   ══════════════════════════════════════ */

/* Tablet Layout (Max 900px) */
@media (min-width: 768px) {
  .app { 
    max-width: 900px; 
    margin: 0 auto; 
  }
  .action-grid, .stats-grid { 
    grid-template-columns: repeat(4, 1fr); 
  }
  .encoder-panel { 
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; 
  }
  .encoder-row { margin-bottom: 0; }
  #patchOptionsWrap, .encoder-stamp-row { grid-column: 1 / -1; }
}

/* Desktop Layout (Max 1200px, Centered Container) */
@media (min-width: 1024px) {
  body { 
    background-color: #050505; 
    padding: 30px 0; 
  }
  .app { 
    max-width: 1200px; 
    margin: 0 auto; 
    border-radius: 24px; 
    box-shadow: 0 10px 50px rgba(0,0,0,0.4); 
    min-height: 90vh;
    border: 1px solid var(--border);
  }
  
  /* Pindah Navigasi Bawah ke Atas */
  .bottom-nav { display: none; }
  .desktop-nav { display: flex; }
  .main-content { padding-bottom: 40px; }
  
  /* Hero lebih besar */
  .hero { padding: 80px 20px 60px; }
  .hero-title { font-size: 48px; }
  
  /* Layout Grid Komponen */
  .features-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .faq-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .faq-item { margin-top: 0; }
  .settings-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
  
  /* Split Kolom untuk Patcher & Encoder agar Card tidak memanjang */
  .mode-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
  .btn-process { width: max-content; margin: 30px auto; padding: 16px 50px; font-size: 16px; }
}
