
:root {
  color-scheme: light;
  --accent: #7145c6;
  --accent-hover: #5d32af;
  --spotify-green-border: #6035ab;
  --bg-color: #f7f7fa;
  --sidebar-bg: #f7f7fa;
  --surface: #ffffff;
  --surface-hover: #f5f2fa;
  --surface-elevated: #f1edf7;
  --surface-alt: #eee9f5;
  --text-main: #201b2d;
  --text-muted: #6e667c;
  --text-soft: #51475f;
  --text-negative: #f3727f;
  --text-warning: #ffa42b;
  --text-announcement: #7145c6;
  --border-light: #dcd5e6;
  --border-strong: #82758f;
  --glass-bg: #ffffff;
  --glass-border: transparent;
  --glass-shadow: rgba(0,0,0,0.5) 0px 8px 24px;
  --shadow-medium: rgba(0,0,0,0.3) 0px 8px 8px;
  --inset-border: rgb(18,18,18) 0px 1px 0px, rgb(124,124,124) 0px 0px 0px 1px inset;
  --spring-easing: cubic-bezier(0.16, 1, 0.3, 1);
  --ai-gradient: #7145c6;
  --font-title: SpotifyMixUITitle, CircularSp, "Inter", "Helvetica Neue", helvetica, arial, "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, "MS Gothic", sans-serif;
  --font-ui: SpotifyMixUI, CircularSp, "Inter", "Helvetica Neue", helvetica, arial, "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, "MS Gothic", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg-color);
}

body {
  font-family: var(--font-ui);
  background: var(--bg-color);
  color: var(--text-main);
  display: flex;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body::before,
body::after {
  display: none !important;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.app-layout {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
  background: var(--bg-color);
}

.sidebar {
  width: 260px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  padding: 24px 14px 16px;
  border-right: 1px solid #ffffff;
  flex-shrink: 0;
  z-index: 10;
}

.nav-brand {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  margin: 0 10px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: var(--accent);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  flex-shrink: 0;
}

.brand-icon svg,
.nav-item svg,
.bottom-nav-item svg {
  stroke-width: 2.2;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  padding: 12px 14px;
  border-radius: 9999px;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  transition: none;
}

.nav-item:hover {
  color: var(--text-main);
  background: var(--surface-hover);
}

.nav-item:hover svg {
  transform: none;
}

.nav-item.active {
  color: var(--text-main);
  background: var(--surface-hover);
  box-shadow: inset 0 0 0 1px rgba(32,27,45,0.04);
}

.nav-item.active svg {
  color: var(--accent);
}

.sidebar-spacer {
  flex: 1;
}

.user-pill-container {
  margin-top: 18px;
}

.user-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 8px 8px 10px;
  background: var(--surface-hover);
  border: 0;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 180ms ease;
  box-shadow: var(--inset-border);
}

.user-pill:hover {
  background: var(--surface-elevated);
  border-color: transparent;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #ffffff;
  flex-shrink: 0;
}

.username {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-badge {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: normal;
  padding: 3px 8px;
  border-radius: 9999px;
  background: var(--accent);
  color: #ffffff;
  box-shadow: none;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #f5f2fa 0%, #f7f7fa 190px, #f7f7fa 100%);
  overflow-y: auto;
  position: relative;
  padding-bottom: 112px;
}

.main-content::-webkit-scrollbar {
  width: 12px;
}

.main-content::-webkit-scrollbar-track {
  background: var(--bg-color);
}

.main-content::-webkit-scrollbar-thumb {
  background: #82758f;
  border: 3px solid var(--bg-color);
  border-radius: 9999px;
}

.main-scroll {
  padding: 32px 32px 48px;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 28px;
}

.page-header h1 {
  font-family: var(--font-title) !important;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 8px;
  color: var(--text-main);
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: currentColor !important;
}

.page-header p {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-muted);
  font-weight: 400;
}

.version-pill {
  font-size: 10.5px;
  line-height: 1.33;
  background: var(--accent);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 9999px;
  font-weight: 700;
  display: inline-block;
  vertical-align: middle;
  margin-left: 10px;
  box-shadow: none;
  letter-spacing: normal;
}

.stepper {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.step-dot {
  flex: 1;
  height: 4px;
  border-radius: 9999px;
  background: #f8f6fb;
  transition: background 240ms ease, opacity 240ms ease;
}

.step-dot.active {
  background: var(--accent);
  box-shadow: none;
}

.step-dot.completed {
  background: var(--text-muted);
  opacity: 0.45;
}

.step-container {
  display: none;
}

.step-container.active {
  display: block;
  animation: fade-in 180ms ease-out;
}

.glass-card {
  background: var(--surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 8px;
  padding: 32px;
  border: 0;
  box-shadow: var(--shadow-medium);
  position: relative;
  overflow: hidden;
  transition: background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.upload-card {
  border: 0;
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  padding: 52px 32px;
  transition: background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
  box-shadow: var(--inset-border), var(--shadow-medium);
}

.upload-card:hover,
.upload-card.drag-active {
  border-color: transparent;
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: rgb(18,18,18) 0px 1px 0px, var(--accent) 0px 0px 0px 1px inset, var(--glass-shadow);
}

.upload-icon-container {
  width: 64px;
  height: 64px;
  background: var(--surface-hover);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 22px;
  border: 0;
  color: var(--text-main);
  box-shadow: var(--inset-border);
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.upload-card:hover .upload-icon-container {
  background: var(--accent);
  color: #ffffff;
  transform: scale(1.04);
  box-shadow: none;
}

.upload-card h3 {
  font-family: var(--font-title);
  font-size: 24px;
  line-height: 1.1;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.upload-card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 24px;
  font-weight: 400;
}

.auth-overlay {
  position: absolute;
  inset: 0;
  background: rgba(18,18,18,0.96);
  backdrop-filter: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  border-radius: inherit;
  padding: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #201b2d;
  color: #ffffff;
  padding: 13px 28px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: transform 120ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
  box-shadow: none;
  text-decoration: none;
}

.btn:hover {
  transform: scale(1.035);
  box-shadow: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn.accent-btn {
  background: var(--accent) !important;
  color: #ffffff !important;
  box-shadow: none;
}

.btn.accent-btn:hover {
  background: var(--accent-hover) !important;
  box-shadow: none;
}

.btn.secondary {
  background: transparent !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--text-main) !important;
  box-shadow: none;
}

.btn.secondary:hover {
  background: var(--surface-hover) !important;
  border-color: var(--text-main) !important;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.bento-item {
  background: var(--surface);
  border: 0;
  border-radius: 8px;
  padding: 22px;
  transition: background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
  box-shadow: inset rgba(32,27,45,0.035) 0 0 0 1px;
}

.bento-item:hover {
  background: var(--surface-hover);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: inset rgba(32,27,45,0.055) 0 0 0 1px, var(--shadow-medium);
}

.bento-item h2,
.settings-info h4,
.mode-card h3,
.metric-val,
.modal-content h2,
#step4 h2,
#procTitle {
  font-family: var(--font-title) !important;
}

.bento-item h2 {
  font-size: 20px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  margin-bottom: 18px !important;
}

.mode-card {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.mode-card.selected {
  background: var(--surface-hover);
  box-shadow: inset var(--accent) 0px 0px 0px 1px, var(--shadow-medium);
}

.mode-card.selected::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
}

.mode-icon {
  width: 44px;
  height: 44px;
  background: var(--surface-hover);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--text-muted);
  transition: background 180ms ease, color 180ms ease;
  box-shadow: var(--inset-border);
}

.mode-card.selected .mode-icon,
.mode-card[data-mode="ai"].selected .mode-icon {
  background: var(--accent);
  color: #ffffff;
  box-shadow: none;
}

.mode-card h3 {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.mode-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.45;
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.metric-card {
  background: var(--surface-hover);
  border: 0;
  border-radius: 8px;
  padding: 16px 12px;
  text-align: center;
  box-shadow: inset rgba(32,27,45,0.04) 0 0 0 1px;
}

.metric-val {
  font-size: 24px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.metric-lbl {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  line-height: 1.5;
}

.segmented-control {
  display: flex;
  background: var(--surface-hover);
  border: 0;
  border-radius: 9999px;
  padding: 4px;
  margin-bottom: 24px;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: var(--inset-border);
}

.seg-btn {
  flex: 1;
  padding: 11px 14px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
  font-family: inherit;
}

.seg-btn:hover {
  color: var(--text-main);
}

.seg-btn.active,
.seg-btn.active.pro-tab {
  background: var(--text-main);
  color: #ffffff;
  box-shadow: none;
  -webkit-text-fill-color: currentColor;
  border: 0;
}

.seg-btn.pro-tab {
  background: transparent;
  color: var(--accent);
  -webkit-background-clip: initial;
  -webkit-text-fill-color: currentColor;
}

.tweak-section {
  display: none;
  animation: fade-in 180ms ease-out;
}

.tweak-section.active {
  display: block;
}

.settings-group {
  background: var(--surface);
  border-radius: 8px;
  padding: 4px 22px;
  border: 0;
  margin-bottom: 24px;
  box-shadow: inset rgba(32,27,45,0.04) 0 0 0 1px, var(--shadow-medium);
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(179,179,179,0.14);
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-info h4 {
  font-size: 16px;
  line-height: 1.3;
  font-weight: 700;
  display: flex;
  align-items: center;
  color: var(--text-main);
}

.settings-info p {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
  margin-top: 4px;
  max-width: 500px;
}

.tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  outline: none;
}

.tooltip-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface-hover);
  color: var(--text-muted);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  font-weight: 700;
  border: 0;
  box-shadow: var(--inset-border);
  transition: background 180ms ease, color 180ms ease;
}

.tooltip-icon:hover {
  background: var(--text-main);
  color: #ffffff;
}

.tooltip-content {
  position: absolute;
  bottom: 140%;
  left: 50%;
  transform: translateX(-50%) translateY(8px) scale(0.98);
  background: var(--surface-elevated);
  border: 0;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-main);
  width: 280px;
  box-shadow: var(--glass-shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 100;
  line-height: 1.5;
  text-align: left;
}

.tooltip-wrap:hover .tooltip-content,
.tooltip-wrap:focus-within .tooltip-content {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  pointer-events: auto;
}

.tooltip-content b {
  color: var(--accent);
}

.ios-switch {
  position: relative;
  width: 52px;
  height: 30px;
  -webkit-appearance: none;
  appearance: none;
  background: #82758f;
  outline: none;
  border-radius: 9999px;
  transition: background 180ms ease;
  cursor: pointer;
  border: 0;
  flex-shrink: 0;
}

.ios-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  background: #201b2d;
  border-radius: 50%;
  transition: transform 180ms ease;
  box-shadow: rgba(0,0,0,0.3) 0px 2px 6px;
}

.ios-switch:checked {
  background: var(--accent);
  box-shadow: none;
}

.ios-switch:checked::after {
  transform: translateX(22px);
  background: #ffffff;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 280px;
}

.slider-val {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  min-width: 62px;
  text-align: right;
}

input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  background: #82758f;
  border-radius: 9999px;
  outline: none;
  accent-color: var(--accent);
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #201b2d;
  box-shadow: rgba(0,0,0,0.5) 0px 2px 8px;
  cursor: pointer;
  transition: transform 120ms ease;
  border: 0;
}

input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.18);
  box-shadow: rgba(0,0,0,0.5) 0px 2px 8px;
}

input[type=range]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #201b2d;
  border: 0;
  box-shadow: rgba(0,0,0,0.5) 0px 2px 8px;
}

.apple-select {
  appearance: none;
  background-color: var(--surface-hover);
  border: 0;
  padding: 12px 38px 12px 16px;
  border-radius: 9999px;
  font-size: 14px;
  color: var(--text-main);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--inset-border);
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23b3b3b3%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 16px top 50%;
  background-size: 10px auto;
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

.apple-select:hover {
  background-color: var(--surface-elevated);
  border-color: transparent;
}

select option {
  background-color: #ffffff !important;
  color: #201b2d !important;
}

.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 92px;
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-top: 1px solid #e4e0ea;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 240ms ease;
  box-shadow: rgba(0,0,0,0.5) 0px -8px 24px;
}

.player-bar.visible {
  transform: translateY(0);
}

.player-left {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 30%;
}

.track-art {
  width: 52px;
  height: 52px;
  background: var(--surface-elevated) !important;
  border-radius: 6px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: rgba(0,0,0,0.5) 0px 8px 24px;
  color: var(--accent);
}

.track-art svg {
  width: 24px;
  height: 24px;
  color: var(--accent) !important;
}

.track-details {
  overflow: hidden;
}

.track-title {
  font-size: 14px !important;
  font-weight: 700 !important;
  margin-bottom: 4px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-subtitle {
  font-size: 12px !important;
  color: var(--text-muted) !important;
  font-weight: 400 !important;
}

.player-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 500px;
}

.play-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.play-btn-circle {
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  background: var(--accent) !important;
  color: #ffffff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none !important;
  cursor: pointer;
  transition: transform 120ms ease, background 180ms ease !important;
  box-shadow: none !important;
  outline: none;
}

.play-btn-circle:hover {
  transform: scale(1.08);
  background: var(--accent-hover) !important;
}

.play-btn-circle:active {
  transform: scale(0.95);
}

.play-btn-circle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.progress-container {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 700;
}

.progress-bar {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px !important;
  background: #82758f !important;
  border-radius: 9999px !important;
  outline: none;
}

.progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #201b2d;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease;
}

.progress-container:hover .progress-bar::-webkit-slider-thumb {
  opacity: 1;
}

.player-right {
  width: 30%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
}

.ab-toggle-control {
  display: flex;
  background: var(--surface-hover) !important;
  border: 0 !important;
  border-radius: 9999px !important;
  padding: 4px !important;
  box-shadow: var(--inset-border);
}

.ab-toggle-btn {
  padding: 8px 18px !important;
  border-radius: 9999px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: var(--text-muted) !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
  text-transform: uppercase;
  letter-spacing: 1.4px !important;
  outline: none;
}

.ab-toggle-btn.active {
  background: var(--text-main) !important;
  color: #ffffff !important;
  box-shadow: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.74);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--surface);
  border: 0;
  border-radius: 8px;
  padding: 36px;
  width: 90%;
  max-width: 440px;
  text-align: center;
  box-shadow: var(--glass-shadow);
  transform: translateY(8px);
  transition: transform 180ms ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-content h2,
#step4 h2,
#procTitle {
  font-size: 24px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
}

.text-input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 9999px;
  background: var(--surface-hover);
  border: 0;
  color: var(--text-main);
  outline: none;
  font-size: 14px;
  transition: box-shadow 180ms ease, background 180ms ease;
  font-family: inherit;
  box-shadow: var(--inset-border);
}

.text-input::placeholder {
  color: #82758f;
}

.text-input:focus {
  background: var(--surface-elevated);
  border-color: transparent;
  box-shadow: rgb(18,18,18) 0px 1px 0px, var(--accent) 0px 0px 0px 1px inset;
}

.status-msg {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 18px;
  display: none;
  font-weight: 700;
}

.status-msg.error {
  background: rgba(243,114,127,0.12);
  color: var(--text-negative);
  border: 0;
  display: block;
}

.status-msg.success {
  background: rgba(113,69,198,0.12);
  color: var(--accent);
  border: 0;
  display: block;
}

.spinner {
  width: 56px;
  height: 56px;
  border: 3px solid #f8f6fb;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 22px;
}

.visualizer-container {
  width: 100%;
  height: 170px;
  background: var(--surface-hover);
  border: 0;
  border-radius: 8px;
  padding: 12px;
  box-sizing: border-box;
  margin: 24px auto;
  position: relative;
  overflow: hidden;
  max-width: 600px;
  box-shadow: inset rgba(32,27,45,0.04) 0 0 0 1px;
}

#spectrumCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.global-nav,
.noise-overlay,
footer {
  display: none !important;
}

.hidden {
  display: none !important;
}

#fileMeta,
#refFileName {
  color: var(--accent) !important;
  font-weight: 700 !important;
}

#resultStats,
#expiresInfo,
#procText {
  color: var(--text-muted) !important;
  font-weight: 400 !important;
}

#procBar {
  background: var(--accent) !important;
}

#step4 .glass-card {
  max-width: 820px;
  box-shadow: var(--glass-shadow);
}

#step4 .glass-card > div[style*="background"] {
  background: var(--surface-hover) !important;
  border: 0 !important;
  border-radius: 8px !important;
  box-shadow: inset rgba(32,27,45,0.04) 0 0 0 1px;
}

.bottom-nav {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1024px) {
  .sidebar {
    width: 228px;
  }

  .main-scroll {
    padding: 28px 24px 44px;
  }

  .bento-grid {
    grid-template-columns: 1fr;
  }

  .bento-item[style*="grid-column"] {
    grid-column: auto !important;
  }
}

@media (max-width: 768px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }

  .app-layout {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar {
    display: none !important;
  }

  .main-content {
    min-height: 100vh;
    height: auto;
    overflow: visible;
    padding-bottom: 90px;
    background: linear-gradient(180deg, #f5f2fa 0%, #f7f7fa 150px, #f7f7fa 100%);
  }

  .main-scroll {
    padding: 24px 16px 32px;
  }

  .dashboard-header {
    margin-bottom: 22px;
  }

  .page-header h1 {
    font-size: 30px;
  }

  .version-pill {
    display: inline-flex;
    margin-left: 6px;
    transform: translateY(-2px);
  }

  .glass-card,
  .upload-card,
  .bento-item,
  .settings-group,
  .modal-content {
    border-radius: 8px;
  }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 68px;
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: 1px solid #e4e0ea;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding: 8px 12px;
    box-sizing: border-box;
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 700;
    gap: 4px;
    transition: color 180ms ease;
    cursor: pointer;
    background: transparent;
    border: none;
    outline: none;
    letter-spacing: 0.02em;
  }

  .bottom-nav-item svg {
    width: 22px;
    height: 22px;
  }

  .bottom-nav-item.active {
    color: var(--accent);
  }

  .bento-grid {
    grid-template-columns: 1fr !important;
  }

  .settings-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 16px 0 !important;
  }

  .slider-container {
    width: 100% !important;
  }

  .apple-select {
    width: 100% !important;
  }

  .segmented-control {
    flex-wrap: wrap !important;
    height: auto !important;
    border-radius: 18px;
  }

  .seg-btn {
    min-width: calc(50% - 4px);
    padding: 10px 6px !important;
    font-size: 11px !important;
  }

  #step2 div[style*="grid-template-columns: repeat(2, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  #step4 .glass-card div[style*="display: flex; align-items: center; justify-content: space-between"] {
    flex-direction: column !important;
    gap: 18px !important;
    align-items: center !important;
    text-align: center !important;
  }

  .player-bar {
    display: none;
  }
}

@media (max-width: 480px) {
  .main-scroll {
    padding-inline: 12px;
  }

  .upload-card {
    padding: 38px 18px;
  }

  .glass-card {
    padding: 22px;
  }

  .settings-group {
    padding: 4px 16px;
  }

  #step2 div[style*="grid-template-columns: repeat(2, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
}

