/* ===== SLIDECRAFT - REAL BEM STYLES ===== */

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #fffbfe; color: #1c1b1f; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
#app { min-height: 100vh; display: flex; flex-direction: column; }
a { color: #6750a4; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ===== APP HEADER ===== */
.app-header {
  background: #fffbfe; border-bottom: 1px solid #cac4d0;
  padding: 12px 16px; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.app-header__left { display: flex; align-items: center; gap: 12px; }
.app-header__logo { font-size: 1.5rem; font-weight: 600; color: #6750a4; }
.app-header__center { flex: 1; display: flex; justify-content: center; }
.app-header__right { display: flex; align-items: center; gap: 8px; }

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  width: 52px; height: 32px; border-radius: 16px;
  border: 2px solid #79747e; background: #e7e0ec;
  position: relative; cursor: pointer; transition: all 0.2s;
}
.theme-toggle::after {
  content: ''; position: absolute; width: 24px; height: 24px;
  border-radius: 50%; background: #6750a4; top: 2px; left: 2px;
  transition: all 0.2s;
}
.theme-toggle--dark { background: #4a4458; border-color: #938f99; }
.theme-toggle--dark::after { left: 22px; background: #d0bcff; }

/* ===== DASHBOARD ===== */
.dashboard-view { flex: 1; display: flex; flex-direction: column; }
.dashboard-view__main { flex: 1; padding: 16px; max-width: 1200px; margin: 0 auto; width: 100%; }
.dashboard-view__toolbar {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 12px; margin-bottom: 24px;
}
.dashboard-view__search {
  display: flex; align-items: center; gap: 8px;
  background: #ece6f0; border-radius: 28px;
  padding: 8px 16px; flex: 1; min-width: 200px; max-width: 400px;
}
.dashboard-view__search input {
  border: none; background: transparent; outline: none;
  flex: 1; font-size: 0.875rem; color: #1c1b1f;
}
.dashboard-view__search input::placeholder { color: #49454f; }
.dashboard-view__filters { display: flex; gap: 8px; }
.dashboard-view__fab {
  position: fixed; bottom: 24px; right: 24px;
  width: 56px; height: 56px; border-radius: 16px;
  background: #eaddff; color: #21005d;
  border: none; font-size: 1.5rem; cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}

/* ===== PROJECT GRID ===== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 16px;
}
@media(min-width:600px){ .project-grid { grid-template-columns: repeat(2,1fr); gap:20px; } }
@media(min-width:960px){ .project-grid { grid-template-columns: repeat(3,1fr); gap:24px; } }
@media(min-width:1280px){ .project-grid { grid-template-columns: repeat(4,1fr); } }

/* ===== PROJECT CARD ===== */
.project-card {
  background: #f7f2fa; border-radius: 12px;
  border: 1px solid #cac4d0; overflow: hidden;
  transition: all 0.2s; cursor: pointer; position: relative;
}
.project-card:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transform: translateY(-2px); border-color: #79747e;
}
.project-card__preview {
  height: 120px; background: #eaddff;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.project-card__placeholder {
  display: flex; align-items: center; justify-content: center;
  color: #6750a4; font-size: 3rem;
}
.project-card__slide-number {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.6); color: white;
  padding: 2px 8px; border-radius: 12px; font-size: 0.75rem;
}
.project-card__body { padding: 12px 16px; }
.project-card__title { font-size: 1rem; font-weight: 500; margin-bottom: 4px; }
.project-card__meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.8125rem; color: #49454f;
}
.project-card__badge {
  display: inline-block; padding: 2px 10px;
  border-radius: 12px; font-size: 0.75rem; font-weight: 500;
}
.project-card__badge--draft { background: #eaddff; color: #21005d; }
.project-card__badge--ready { background: #e8def8; color: #1d192b; }
.project-card__badge--analyzing { background: #ffd8e4; color: #31111d; }
.project-card__menu-btn {
  background: none; border: none; cursor: pointer;
  padding: 4px; border-radius: 50%; color: #49454f;
}
.project-card__menu-btn:hover { background: #e7e0ec; }
.project-card__menu {
  position: absolute; right: 8px; top: 40px;
  background: #fffbfe; border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 8px 0; min-width: 160px; z-index: 10;
}
.project-card__menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; font-size: 0.875rem;
  color: #1c1b1f; cursor: pointer; border: none;
  background: none; width: 100%; text-align: left;
}
.project-card__menu-item:hover { background: #f3edf7; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 24px; border-radius: 20px;
  border: none; font-size: 0.875rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
  min-height: 40px; letter-spacing: 0.025em;
}
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn--filled { background: #6750a4; color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.btn--tonal { background: #e8def8; color: #1d192b; }
.btn--outlined { background: transparent; color: #6750a4; border: 1px solid #79747e; }
.btn--text { background: transparent; color: #6750a4; padding: 10px 12px; }
.btn--small { padding: 6px 16px; min-height: 32px; font-size: 0.8125rem; border-radius: 16px; }
.btn:disabled { opacity: 0.38; cursor: not-allowed; transform: none; }

.toolbar-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 8px 16px; border-radius: 8px;
  border: none; background: transparent; color: #1c1b1f;
  font-size: 0.875rem; cursor: pointer; transition: all 0.15s;
}
.toolbar-btn:hover { background: #e7e0ec; }
.toolbar-btn--tonal { background: #e8def8; color: #1d192b; }

.viewer-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.15);
  color: white; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  font-size: 1.25rem; transition: all 0.2s;
}
.viewer-btn:hover { background: rgba(255,255,255,0.3); }
.viewer-btn--large { width: 48px; height: 48px; font-size: 1.5rem; }

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 64px 24px; text-align: center; gap: 16px;
}
.empty-state__icon {
  width: 120px; height: 120px; opacity: 0.4; margin-bottom: 8px;
  color: #6750a4;
}
.empty-state__title { font-size: 1.25rem; font-weight: 500; }
.empty-state__description { font-size: 0.875rem; color: #49454f; max-width: 400px; }

/* ===== WIZARD ===== */
.wizard-stepper {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 32px; overflow-x: auto; padding-bottom: 8px;
}
.step {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.step__number {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem; font-weight: 500;
  background: #6750a4; color: #fff; flex-shrink: 0;
}
.step--inactive .step__number { background: #e7e0ec; color: #49454f; }
.step__title { font-size: 0.875rem; font-weight: 500; }
.step__subtitle { font-size: 0.75rem; color: #49454f; }
.step__connector {
  width: 24px; height: 2px; background: #6750a4; flex-shrink: 0;
}
.step--inactive .step__connector { background: #cac4d0; }
.step__actions {
  display: flex; gap: 12px; margin-top: 24px;
  justify-content: flex-end;
}

/* ===== FORM FIELDS ===== */
.form-field { margin-bottom: 20px; }
.form-field--full { width: 100%; }
.form-field__label {
  display: block; font-size: 0.875rem; font-weight: 500;
  color: #1c1b1f; margin-bottom: 6px;
}
.form-field__input, .form-field__textarea, .form-field__select {
  width: 100%; padding: 12px 16px; border-radius: 8px;
  border: 1px solid #79747e; background: #f7f2fa;
  color: #1c1b1f; font-size: 0.9375rem; outline: none;
  transition: border-color 0.2s;
}
.form-field__input:focus, .form-field__textarea:focus, .form-field__select:focus {
  border-color: #6750a4; border-width: 2px; padding: 11px 15px;
}
.form-field__textarea { min-height: 100px; resize: vertical; }

/* ===== PROP FIELDS (Editor sidebar) ===== */
.prop-section { margin-bottom: 20px; }
.prop-section__title {
  font-size: 0.8125rem; font-weight: 600;
  color: #6750a4; text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 12px;
}
.prop-field { margin-bottom: 16px; }
.prop-field--row {
  display: flex; align-items: center; gap: 12px;
}
.prop-field__label {
  font-size: 0.8125rem; color: #49454f; margin-bottom: 4px;
  display: block;
}
.prop-field__input {
  width: 100%; padding: 8px 12px; border-radius: 6px;
  border: 1px solid #cac4d0; background: #fffbfe;
  font-size: 0.875rem; outline: none;
}
.prop-field__input:focus { border-color: #6750a4; }
.prop-btn {
  padding: 6px 12px; border-radius: 6px;
  border: 1px solid #cac4d0; background: #f7f2fa;
  cursor: pointer; font-size: 0.8125rem;
}
.prop-btn:hover { background: #eaddff; border-color: #6750a4; }

/* ===== CHAT ===== */
.chat-panel {
  display: flex; flex-direction: column;
  border: 1px solid #cac4d0; border-radius: 12px;
  overflow: hidden; height: 100%; max-height: 600px;
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.chat-message {
  max-width: 85%; padding: 12px 16px; border-radius: 18px;
  font-size: 0.9375rem; line-height: 1.5;
}
@media(min-width:600px){ .chat-message { max-width: 75%; } }
.chat-message--user {
  align-self: flex-end; background: #eaddff; color: #21005d;
  border-bottom-right-radius: 4px;
}
.chat-message--assistant {
  align-self: flex-start; background: #ece6f0; color: #1c1b1f;
  border-bottom-left-radius: 4px;
}
.chat-message__content { display: flex; gap: 12px; align-items: flex-start; }
.chat-message__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.chat-message--user .chat-message__avatar { background: #6750a4; color: #fff; }
.chat-message--assistant .chat-message__avatar { background: #e8def8; color: #1d192b; }
.chat-message__text { flex: 1; }
.chat-message__time {
  font-size: 0.6875rem; color: #49454f; margin-top: 4px;
}
.chat-input {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid #cac4d0; background: #fffbfe;
}
.chat-input input {
  flex: 1; padding: 10px 16px; border-radius: 24px;
  border: 1px solid #79747e; background: #f7f2fa;
  outline: none; font-size: 0.9375rem;
}
.chat-input input:focus { border-color: #6750a4; }
.typing-indicator {
  display: flex; gap: 4px; padding: 12px 16px;
}
.typing-indicator span {
  width: 8px; height: 8px; border-radius: 50%;
  background: #79747e; animation: bounce 1.4s ease infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%,80%,100%{transform:translateY(0);}40%{transform:translateY(-8px);} }

/* ===== VOICE INPUT ===== */
.voice-input {
  display: flex; flex-direction: column;
  align-items: center; gap: 12px; padding: 24px;
}
.voice-btn {
  width: 64px; height: 64px; border-radius: 50%;
  background: #eaddff; color: #21005d;
  border: none; font-size: 1.75rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.voice-btn:hover { background: #d0bcff; transform: scale(1.05); }
.voice-btn--recording {
  background: #b3261e; color: #fff;
  animation: pulse 1.5s ease infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(179,38,30,0.4); }
  70% { box-shadow: 0 0 0 16px rgba(179,38,30,0); }
  100% { box-shadow: 0 0 0 0 rgba(179,38,30,0); }
}
.voice-input__label { font-size: 0.875rem; color: #49454f; }
.voice-input__timer { font-size: 1.5rem; font-weight: 500; color: #b3261e; }

/* ===== FILE UPLOAD ===== */
.file-upload {
  border: 2px dashed #79747e; border-radius: 16px;
  padding: 40px 24px; text-align: center;
  transition: all 0.2s; cursor: pointer;
}
.file-upload:hover, .file-upload--active {
  border-color: #6750a4; background: #eaddff;
}
.file-upload__icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.6; }
.file-upload__text { font-size: 1rem; margin-bottom: 4px; }
.file-upload__hint { font-size: 0.8125rem; color: #49454f; }

/* ===== EDITOR ===== */
.slide-editor {
  display: flex; flex-direction: column;
  height: calc(100vh - 60px);
}
.slide-editor__toolbar {
  display: flex; align-items: center;
  justify-content: space-between; padding: 8px 16px;
  background: #fffbfe; border-bottom: 1px solid #cac4d0;
  gap: 8px; flex-wrap: wrap;
}
.slide-editor__workspace {
  display: flex; flex: 1; overflow: hidden;
}
.slide-editor__sidebar {
  width: 200px; min-width: 200px;
  background: #f3edf7; border-right: 1px solid #cac4d0;
  overflow-y: auto; padding: 12px;
  display: none;
}
@media(min-width:960px){ .slide-editor__sidebar { display: block; } }

.slide-editor__canvas {
  flex: 1; display: flex;
  align-items: center; justify-content: center;
  background: #e0e0e0; padding: 16px; overflow: auto;
}
.slide-editor__properties {
  width: 280px; min-width: 280px;
  background: #f3edf7; border-left: 1px solid #cac4d0;
  padding: 16px; overflow-y: auto; display: none;
}
@media(min-width:1280px){ .slide-editor__properties { display: block; } }

/* ===== SLIDE PREVIEW ===== */
.slide-preview {
  background: white; border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  width: 100%; max-width: 640px;
  aspect-ratio: 16 / 9; padding: 32px;
  display: flex; flex-direction: column;
}
.slide-preview--wide { max-width: 960px; }

/* ===== SLIDE TYPES ===== */
.slide-title {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%; text-align: center; gap: 12px;
}
.slide-title h1 {
  font-size: clamp(1.25rem, 3.5vw, 2rem);
  font-weight: 400; color: #6750a4;
}
.slide-title h2 {
  font-size: clamp(0.875rem, 2vw, 1.25rem);
  font-weight: 400; color: #49454f;
}
.slide-content { padding: 16px; height: 100%; overflow: auto; }
.slide-content h2 {
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  font-weight: 500; margin-bottom: 12px; color: #6750a4;
}
.slide-content p {
  font-size: clamp(0.8rem, 1.8vw, 1rem);
  line-height: 1.6; margin-bottom: 10px;
}
.slide-content ul { padding-left: 20px; }
.slide-content li {
  font-size: clamp(0.8rem, 1.8vw, 1rem);
  line-height: 1.6; margin-bottom: 6px;
}

.slide-image { display: flex; flex-direction: column; height: 100%; }
.slide-image__title {
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  font-weight: 500; margin-bottom: 12px; color: #6750a4;
}
.slide-image__side { display: flex; gap: 16px; flex: 1; }
.slide-image__text-col { flex: 1; }
.slide-image__text { font-size: 0.9375rem; line-height: 1.6; }
.slide-image__caption { font-size: 0.8125rem; color: #49454f; margin-top: 8px; }

.slide-quote {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%; text-align: center; gap: 16px; padding: 24px;
}
.slide-quote__mark { font-size: 4rem; color: #6750a4; line-height: 1; }

.slide-two-column { display: flex; gap: 24px; height: 100%; }
.slide-two-column__col { flex: 1; display: flex; flex-direction: column; }
.slide-two-column__col-title {
  font-size: 1.1rem; font-weight: 500;
  margin-bottom: 12px; color: #6750a4;
}
.slide-two-column__text { font-size: 0.9375rem; line-height: 1.6; }
.slide-two-column__list { padding-left: 20px; }
.slide-two-column__img { border-radius: 8px; max-width: 100%; margin-top: 12px; }

/* ===== SLIDE NAVIGATOR ===== */
.slide-navigator {
  display: flex; flex-direction: column; gap: 8px;
}
.slide-thumbnail {
  border-radius: 8px; padding: 8px;
  cursor: pointer; border: 2px solid transparent;
  transition: all 0.15s; background: #fffbfe;
}
.slide-thumbnail:hover { background: #e7e0ec; }
.slide-thumbnail--active { border-color: #6750a4; background: #eaddff; }
.slide-thumbnail__preview {
  width: 100%; aspect-ratio: 16/9;
  background: white; border-radius: 4px;
  overflow: hidden; font-size: 0.5rem;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.slide-thumbnail__btn {
  width: 100%; padding: 6px;
  border-radius: 6px; border: 1px dashed #cac4d0;
  background: transparent; cursor: pointer;
  color: #6750a4; font-size: 1.25rem;
}
.slide-thumbnail__btn:hover { background: #eaddff; border-color: #6750a4; }

/* ===== ZOOM CONTROL ===== */
.zoom-control {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: #fffbfe;
  border-top: 1px solid #cac4d0;
}

/* ===== VIEWER ===== */
.presentation-viewer {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 100vh; background: #1a1a2e;
  padding: 16px;
}
.viewer-slide {
  background: white; border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  width: 100%; max-width: 960px;
  aspect-ratio: 16 / 9; padding: 32px;
  overflow: hidden;
}
.viewer-controls {
  display: flex; align-items: center;
  gap: 16px; margin-top: 16px; color: white;
}
.viewer-progress {
  display: flex; gap: 6px; align-items: center;
}
.viewer-progress__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.3); cursor: pointer;
}
.viewer-progress__dot--active { background: white; }

/* ===== DIALOG ===== */
.dialog-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center;
  justify-content: center; z-index: 200; padding: 16px;
}
.dialog {
  background: #ece6f0; border-radius: 28px;
  padding: 24px; max-width: 560px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  animation: dialogIn 0.2s ease;
}
@keyframes dialogIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.dialog__title { font-size: 1.25rem; font-weight: 500; margin-bottom: 16px; }
.dialog__actions {
  display: flex; justify-content: flex-end;
  gap: 8px; margin-top: 24px;
}
.dialog__btn { padding: 8px 16px; border-radius: 8px; border: none; cursor: pointer; }

/* ===== SPINNER ===== */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid #e7e0ec;
  border-top-color: #6750a4; border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cac4d0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #79747e; }

/* ===== MOBILE ADAPTATIONS ===== */
@media(max-width:599px){
  .app-header { padding: 10px 12px; }
  .app-header__logo { font-size: 1.25rem; }
  .app-header__center { display: none; }
  .dashboard-view__main { padding: 12px; }
  .dashboard-view__toolbar { flex-direction: column; align-items: stretch; }
  .dashboard-view__search { max-width: none; }
  .wizard-stepper { gap: 4px; }
  .step__title { font-size: 0.75rem; }
  .slide-editor__workspace { flex-direction: column; }
  .slide-editor__sidebar { width: 100%; height: 100px; border-right: none; border-bottom: 1px solid #cac4d0; flex-direction: row; overflow-x: auto; }
  .slide-editor__properties { width: 100%; border-left: none; border-top: 1px solid #cac4d0; }
  .slide-preview { padding: 16px; }
  .slide-two-column { flex-direction: column; }
  .viewer-slide { padding: 16px; }
  .chat-message { max-width: 90%; padding: 10px 14px; font-size: 0.875rem; }
}

/* ===== TABLE ===== */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th {
  background: #6750a4; color: #fff;
  padding: 12px 16px; text-align: left; font-weight: 500;
}
.data-table td { padding: 10px 16px; border-bottom: 1px solid #cac4d0; }
.data-table tr:hover td { background: #f3edf7; }

/* ===== SNACKBAR ===== */
.snackbar {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: #322f35; color: #f5eff7;
  padding: 14px 24px; border-radius: 8px;
  font-size: 0.875rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  z-index: 1000; animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateX(-50%) translateY(100px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ===== BASE ELEMENT STYLES (buttons without classes) ===== */
button:not([class]) {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 24px; border-radius: 20px;
  border: none; background: #6750a4; color: #fff;
  font-size: 0.875rem; font-weight: 500; cursor: pointer;
  transition: all 0.2s; letter-spacing: 0.025em;
}
button:not([class]):hover { opacity: 0.9; transform: translateY(-1px); }

/* Center empty state */
.empty-state {
  margin: 0 auto;
  max-width: 400px;
}

/* Ensure app fills viewport */
.app, .dashboard-view, .create-view, .editor-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Create view layout */
.create-view__main {
  flex: 1;
  padding: 24px 16px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

/* Editor view */
.editor-view { height: 100vh; }

/* ===== MATERIAL BUTTON ===== */
.md-button {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 24px; border-radius: 20px;
  border: none; font-size: 0.875rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
  letter-spacing: 0.025em; white-space: nowrap;
  min-height: 40px; position: relative; overflow: hidden;
}
.md-button:hover { opacity: 0.9; transform: translateY(-1px); }
.md-button:active { transform: translateY(0); }
.md-button:disabled { opacity: 0.38; cursor: not-allowed; transform: none; }

.md-button--filled {
  background: #6750a4; color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.md-button--filled:hover { background: #7c66b6; }

.md-button--tonal {
  background: #e8def8; color: #1d192b;
}
.md-button--tonal:hover { background: #d0bcff; }

.md-button--outlined {
  background: transparent; color: #6750a4;
  border: 1px solid #79747e;
}
.md-button--outlined:hover { background: rgba(103,80,164,0.05); }

.md-button--text {
  background: transparent; color: #6750a4;
  padding: 10px 12px;
}
.md-button--text:hover { background: rgba(103,80,164,0.05); }

.md-button--elevated {
  background: #eaddff; color: #21005d;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.md-button--small { padding: 6px 16px; min-height: 32px; font-size: 0.8125rem; border-radius: 16px; }
.md-button--large { padding: 14px 32px; min-height: 48px; font-size: 1rem; }

.md-button__icon {
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
}
.md-button__label { line-height: 1; }

/* ===== APP SPECIFIC ===== */
.app-header__center { display: flex; justify-content: center; }

/* ===== PROJECT GRID EMPTY STATE ===== */
.project-grid__empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 64px 24px; text-align: center; gap: 12px;
  grid-column: 1 / -1;
  color: #49454f;
}
.project-grid__empty svg { color: #6750a4; opacity: 0.5; margin-bottom: 8px; }
.project-grid__empty-title { font-size: 1.25rem; font-weight: 500; color: #1c1b1f; }
.project-grid__empty-text { font-size: 0.875rem; color: #49454f; }
.project-grid__empty-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 24px; border-radius: 20px;
  border: none; background: #6750a4; color: #fff;
  font-size: 0.875rem; font-weight: 500; cursor: pointer;
  margin-top: 12px;
}
.project-grid__empty-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* ===== PROJECT GRID LIST ===== */
.project-grid__list { display: contents; }

/* ===== CREATE VIEW ===== */
.create-view { min-height: 100vh; display: flex; flex-direction: column; background: #fffbfe; }
.create-view__main {
  flex: 1; padding: 24px 16px;
  max-width: 720px; margin: 0 auto;
  width: 100%;
}
@media(min-width:600px){ .create-view__main { padding: 32px 24px; } }

/* ===== WIZARD STEPPER ===== */
.wizard-stepper {
  display: flex; align-items: center;
  gap: 4px; margin-bottom: 32px;
  padding: 16px 0; border-bottom: 1px solid #e7e0ec;
  overflow-x: auto;
}
.step {
  display: flex; align-items: center;
  gap: 8px; white-space: nowrap;
  flex-shrink: 0;
}
.step__number {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8125rem; font-weight: 600;
  background: #6750a4; color: #fff; flex-shrink: 0;
}
.step--inactive .step__number {
  background: #e7e0ec; color: #49454f;
}
.step__title { font-size: 0.875rem; font-weight: 500; }
.step__connector {
  width: 20px; height: 1px;
  background: #6750a4; flex-shrink: 0; margin: 0 4px;
}
.step--inactive .step__connector { background: #cac4d0; }

/* ===== STEP FORM ===== */
.step-form__title {
  font-size: 1.25rem; font-weight: 500;
  color: #1c1b1f; margin-bottom: 24px;
}
.step-form__field { margin-bottom: 20px; }
.step-form__field label {
  display: block; font-size: 0.875rem;
  font-weight: 500; color: #1c1b1f;
  margin-bottom: 6px;
}
.step-form__field input,
.step-form__field select,
.step-form__field textarea {
  width: 100%; padding: 12px 16px;
  border-radius: 8px; border: 1px solid #79747e;
  background: #f7f2fa; color: #1c1b1f;
  font-size: 0.9375rem; outline: none;
}
.step-form__field input:focus,
.step-form__field select:focus,
.step-form__field textarea:focus {
  border-color: #6750a4; border-width: 2px;
}
.step-form__field textarea { min-height: 80px; resize: vertical; }

/* Theses */
.theses-input { display: flex; gap: 8px; margin-bottom: 8px; }
.theses-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.thesis-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 16px;
  background: #eaddff; color: #21005d;
  font-size: 0.8125rem;
}
.thesis-tag button {
  background: none; border: none; cursor: pointer;
  color: #21005d; font-size: 1rem; line-height: 1;
  padding: 0; width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
}

/* Step actions */
.step-actions {
  display: flex; justify-content: flex-end; gap: 12px;
  margin-top: 32px; padding-top: 16px;
  border-top: 1px solid #e7e0ec;
}

/* Voice button */
.voice-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%;
  border: none; background: #eaddff; color: #21005d;
  font-size: 1.25rem; cursor: pointer; margin-left: 8px;
  transition: all 0.2s; flex-shrink: 0;
}
.voice-btn:hover { transform: scale(1.05); }
.voice-btn--recording { background: #b3261e; color: #fff; animation: pulse 1.5s ease infinite; }

/* File upload */
.file-upload {
  border: 2px dashed #79747e; border-radius: 16px;
  padding: 48px 24px; text-align: center;
  cursor: pointer; transition: all 0.2s;
  margin: 16px 0;
}
.file-upload:hover, .file-upload--active {
  border-color: #6750a4; background: rgba(103,80,164,0.04);
}
.file-upload__icon { font-size: 3rem; margin-bottom: 12px; }
.file-upload__title { font-size: 1rem; font-weight: 500; margin-bottom: 4px; }
.file-upload__hint { font-size: 0.8125rem; color: #49454f; }

/* Uploaded files list */
.uploaded-files { margin: 16px 0; }
.uploaded-file {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: #f7f2fa;
  border-radius: 8px; margin-bottom: 8px;
}
.uploaded-file__name { font-size: 0.875rem; }
.uploaded-file__remove {
  background: none; border: none; color: #b3261e;
  cursor: pointer; font-size: 1rem;
}

/* ===== MOBILE-FIRST OVERRIDES ===== */
@media(max-width:599px){
  /* Header - hide center button, shrink */
  .app-header { padding: 10px 12px; flex-wrap: nowrap; }
  .app-header__logo { font-size: 1.15rem; }
  .app-header__center { display: none !important; } /* hide "create" button, FAB is enough */

  /* Toolbar - stack vertically */
  .dashboard-view__toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .dashboard-view__search { max-width: none; }
  .dashboard-view__filters { justify-content: space-between; }
  .dashboard-view__filters select { flex: 1; }

  /* Form fields - larger touch targets */
  .text-field, .form-field__input, .form-field__select, .form-field__textarea,
  .step-form__field input, .step-form__field select, .step-form__field textarea {
    font-size: 16px !important; /* prevent iOS zoom */
    padding: 14px 16px !important;
    min-height: 48px;
  }

  /* Buttons - larger touch targets */
  .btn, .md-button, button:not([class]) {
    min-height: 44px;
    padding: 12px 20px;
  }

  /* Wizard stepper - smaller */
  .wizard-stepper { gap: 2px; margin-bottom: 20px; }
  .step__number { width: 24px; height: 24px; font-size: 0.75rem; }
  .step__title { font-size: 0.75rem; }
  .step__connector { width: 12px; }

  /* Create view */
  .create-view__main { padding: 16px 12px; }

  /* FAB - reposition for mobile */
  .dashboard-view__fab { bottom: 16px; right: 16px; width: 48px; height: 48px; }

  /* Chat - full width messages */
  .chat-message { max-width: 92%; padding: 10px 14px; }

  /* Slide editor - stacked */
  .slide-editor__workspace { flex-direction: column; }
  .slide-editor__sidebar {
    display: flex !important; width: 100%; height: 80px;
    flex-direction: row; overflow-x: auto; border-right: none;
    border-bottom: 1px solid #cac4d0; padding: 8px;
  }
  .slide-editor__canvas { padding: 12px; }
  .slide-preview { padding: 16px; }

  /* Two column slides - stack */
  .slide-two-column { flex-direction: column; gap: 12px; }

  /* Tables - horizontal scroll */
  .data-table { display: block; overflow-x: auto; }

  /* File upload */
  .file-upload { padding: 32px 16px; }

  /* Typography - larger for mobile */
  .page-title { font-size: 1.5rem; }
  .slide-title h1 { font-size: 1.3rem; }
  .slide-content h2 { font-size: 1.1rem; }

  /* General padding reduction */
  .main-content { padding: 12px 0; }
  .container { padding: 0 12px; }
  .card { padding: 12px; }

  /* Viewer */
  .presentation-viewer { padding: 8px; }
  .viewer-slide { padding: 16px; }

  /* Dialog - full screen on small */
  .dialog { border-radius: 16px; padding: 16px; max-height: 95vh; }

  /* Voice button */
  .voice-btn { width: 56px; height: 56px; font-size: 1.5rem; }
}

/* ===== TABLET ===== */
@media(min-width:600px) and (max-width:959px){
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .slide-editor__properties { display: none; }
}
