/* ============================================
   Brief Builder — Google Material Design CSS
   ============================================ */

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

:root {
  --md-primary: #1a73e8;
  --md-primary-dark: #1557b0;
  --md-primary-light: #e8f0fe;
  --md-surface: #ffffff;
  --md-background: #f8f9fa;
  --md-text: #202124;
  --md-text-secondary: #5f6368;
  --md-border: #dadce0;
  --md-error: #d93025;
  --md-success: #1e8e3e;
  --md-warning: #f9ab00;
  --md-radius: 8px;
  --md-radius-sm: 4px;
  --md-shadow-1: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
  --md-shadow-2: 0 1px 2px 0 rgba(60,64,67,.3), 0 2px 6px 2px rgba(60,64,67,.15);
  --md-shadow-3: 0 4px 8px 3px rgba(60,64,67,.15), 0 1px 3px rgba(60,64,67,.3);
}

body {
  font-family: 'Google Sans', Roboto, -apple-system, BlinkMacSystemFont,
    'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--md-background);
  color: var(--md-text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---- Animations ---- */

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

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

@keyframes snackbarIn {
  from { opacity: 0; transform: translateY(100%); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   App Bar
   ============================================ */

.app-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: 64px;
  background: var(--md-surface);
  box-shadow: var(--md-shadow-1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-bar__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--md-text);
  font-size: 20px;
  flex-shrink: 0;
  transition: background 0.15s;
}

.app-bar__back:hover {
  background: var(--md-background);
}

.app-bar__title {
  font-size: 18px;
  font-weight: 500;
  color: var(--md-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-bar__title a {
  color: inherit;
  text-decoration: none;
}

.app-bar__logo {
  font-size: 20px;
  font-weight: 600;
  color: var(--md-primary);
  letter-spacing: -0.3px;
}

.app-bar__spacer {
  flex: 1;
}

.app-bar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

/* ============================================
   Buttons
   ============================================ */

.md-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 24px;
  border-radius: var(--md-radius-sm);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--md-primary);
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.5;
  letter-spacing: 0.25px;
  user-select: none;
}

.md-btn:disabled {
  opacity: 0.38;
  cursor: default;
  pointer-events: none;
}

.md-btn--primary {
  background: var(--md-primary);
  color: #fff;
}

.md-btn--primary:hover {
  background: var(--md-primary-dark);
  box-shadow: var(--md-shadow-1);
}

.md-btn--primary:active {
  box-shadow: none;
}

.md-btn--outline {
  border: 1px solid var(--md-border);
  color: var(--md-primary);
  background: var(--md-surface);
}

.md-btn--outline:hover {
  background: var(--md-primary-light);
  border-color: var(--md-primary);
}

.md-btn--text {
  padding: 8px 12px;
  color: var(--md-primary);
}

.md-btn--text:hover {
  background: var(--md-primary-light);
}

.md-btn--icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
  color: var(--md-text-secondary);
}

.md-btn--icon:hover {
  background: var(--md-background);
}

.md-btn--fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--md-primary);
  color: #fff;
  font-size: 24px;
  box-shadow: var(--md-shadow-3);
  z-index: 50;
  padding: 0;
}

.md-btn--fab:hover {
  box-shadow: 0 6px 10px 4px rgba(60,64,67,.15), 0 2px 3px rgba(60,64,67,.3);
  background: var(--md-primary-dark);
}

/* ============================================
   Cards
   ============================================ */

.md-card {
  background: var(--md-surface);
  border: 1px solid var(--md-border);
  border-radius: var(--md-radius);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.md-card:hover {
  box-shadow: var(--md-shadow-2);
  border-color: transparent;
}

/* ============================================
   Form Fields
   ============================================ */

.md-field {
  margin-bottom: 20px;
}

.md-field__label,
.md-field > label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--md-text);
  margin-bottom: 6px;
  letter-spacing: 0.1px;
}

.required {
  color: var(--md-error);
  margin-left: 2px;
}

.md-field input[type="text"],
.md-field input[type="email"],
.md-field input[type="password"],
.md-field input[type="number"],
.md-field input[type="date"],
.md-field textarea,
.md-field select,
.md-field__input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--md-border);
  border-radius: var(--md-radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--md-text);
  background: var(--md-surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  line-height: 1.5;
  outline: none;
}

.md-field input:focus,
.md-field textarea:focus,
.md-field select:focus {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 2px var(--md-primary-light);
}

.md-field input::placeholder,
.md-field textarea::placeholder {
  color: #9aa0a6;
}

.md-field textarea {
  resize: vertical;
  min-height: 80px;
}

.md-field--error input,
.md-field--error textarea {
  border-color: var(--md-error);
}

.md-field--error input:focus,
.md-field--error textarea:focus {
  box-shadow: 0 0 0 2px #fce8e6;
}

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

.md-field__error {
  font-size: 12px;
  color: var(--md-error);
  margin-top: 4px;
}

.field-row {
  display: flex;
  gap: 16px;
}

.field-row > .md-field {
  flex: 1;
}

/* ============================================
   Checkbox & Chip
   ============================================ */

.md-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 4px;
}

.md-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--md-text);
  user-select: none;
}

.md-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--md-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.md-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 13px;
  border: 1px solid var(--md-border);
  background: var(--md-surface);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.md-chip:hover {
  background: var(--md-background);
}

.md-chip--selected {
  background: var(--md-primary-light);
  border-color: var(--md-primary);
  color: var(--md-primary);
}

/* ============================================
   Dialog / Modal
   ============================================ */

.md-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.md-dialog {
  background: var(--md-surface);
  border-radius: var(--md-radius);
  padding: 24px;
  width: 90%;
  max-width: 480px;
  box-shadow: var(--md-shadow-3);
  animation: slideUp 0.2s ease;
}

.md-dialog__title {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 16px;
  color: var(--md-text);
}

.md-dialog__body {
  font-size: 14px;
  color: var(--md-text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

.md-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ============================================
   Snackbar / Toast
   ============================================ */

.md-snackbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  background: #323232;
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--md-radius-sm);
  font-size: 14px;
  box-shadow: var(--md-shadow-3);
  z-index: 2000;
  max-width: 90vw;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.md-snackbar.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   Avatar
   ============================================ */

.md-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--md-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
  user-select: none;
  text-transform: uppercase;
}

/* ============================================
   Dropdown Menu
   ============================================ */

.user-menu {
  position: relative;
}

.user-menu__trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--md-radius);
  transition: background 0.15s;
}

.user-menu__trigger:hover {
  background: var(--md-background);
}

.user-menu__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--md-text);
}

.md-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--md-surface);
  border-radius: var(--md-radius);
  box-shadow: var(--md-shadow-3);
  min-width: 200px;
  padding: 8px 0;
  z-index: 200;
  display: none;
}

.md-menu.open {
  display: block;
  animation: fadeIn 0.15s ease;
}

.md-menu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--md-text);
  cursor: pointer;
  transition: background 0.1s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.md-menu__item:hover {
  background: var(--md-background);
}

.md-menu__item--danger {
  color: var(--md-error);
}

.md-menu__divider {
  height: 1px;
  background: var(--md-border);
  margin: 4px 0;
}

/* ============================================
   Badge
   ============================================ */

.md-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.md-badge--draft {
  background: #fef7e0;
  color: #b36b00;
}

.md-badge--completed {
  background: #e6f4ea;
  color: var(--md-success);
}

/* ============================================
   Divider
   ============================================ */

.md-divider {
  height: 1px;
  background: var(--md-border);
  border: none;
  margin: 16px 0;
}

/* ============================================
   Auth Page
   ============================================ */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--md-background);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 450px;
  background: var(--md-surface);
  border-radius: var(--md-radius);
  border: 1px solid var(--md-border);
  animation: slideUp 0.3s ease;
}

.auth-card__header {
  text-align: center;
  padding: 40px 40px 24px;
}

.auth-card__logo {
  font-size: 28px;
  font-weight: 600;
  color: var(--md-primary);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.auth-card__subtitle {
  font-size: 14px;
  color: var(--md-text-secondary);
}

.auth-card__body {
  padding: 0 40px;
}

.auth-card__footer {
  padding: 16px 40px 40px;
  text-align: center;
}

.auth-card__footer a {
  color: var(--md-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.auth-card__footer a:hover {
  text-decoration: underline;
}

.auth-error {
  background: #fce8e6;
  color: var(--md-error);
  padding: 10px 14px;
  border-radius: var(--md-radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.auth-error.visible {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* ============================================
   Dashboard
   ============================================ */

.dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.dashboard__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.dashboard__title {
  font-size: 22px;
  font-weight: 400;
  color: var(--md-text);
}

.search-bar {
  position: relative;
  flex: 0 1 360px;
}

.search-bar input,
.search-bar__input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: 1px solid var(--md-border);
  border-radius: 100px;
  font-size: 14px;
  font-family: inherit;
  color: var(--md-text);
  background: var(--md-surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-bar input:focus,
.search-bar__input:focus {
  border-color: var(--md-primary);
  box-shadow: var(--md-shadow-1);
}

.search-bar__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--md-text-secondary);
  font-size: 16px;
  pointer-events: none;
}

/* ---- Brief Grid ---- */

.brief-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.brief-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.brief-card__title {
  font-size: 16px;
  font-weight: 500;
  color: var(--md-text);
  line-height: 1.4;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.brief-card__meta {
  font-size: 12px;
  color: var(--md-text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brief-card__snippet {
  font-size: 13px;
  color: var(--md-text-secondary);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.brief-card__actions {
  display: flex;
  gap: 4px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--md-border);
  opacity: 0;
  transition: opacity 0.15s;
}

.brief-card:hover .brief-card__actions {
  opacity: 1;
}

/* ============================================
   Editor Layout
   ============================================ */

.editor-layout {
  display: flex;
  height: calc(100vh - 64px);
}

/* ---- Step Sidebar ---- */

.step-sidebar {
  width: 240px;
  background: var(--md-surface);
  border-right: 1px solid var(--md-border);
  padding: 8px 0;
  overflow-y: auto;
  flex-shrink: 0;
}

.step-sidebar__list {
  list-style: none;
}

.step-sidebar__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  font-size: 13px;
  color: var(--md-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
  user-select: none;
}

.step-sidebar__item:hover {
  background: var(--md-background);
}

.step-sidebar__item--active {
  color: var(--md-primary);
  font-weight: 500;
  background: var(--md-primary-light);
  border-left-color: var(--md-primary);
}

.step-sidebar__item--completed {
  color: var(--md-success);
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--md-border);
  flex-shrink: 0;
}

.step-sidebar__item--active .step-dot {
  background: var(--md-primary);
}

.step-sidebar__item--completed .step-dot {
  background: var(--md-success);
}

/* ---- Form Area ---- */

.form-area {
  flex: 1;
  padding: 32px 48px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.form-step {
  display: none;
  animation: fadeIn 0.25s ease;
}

.form-step.active {
  display: block;
}

.form-step h2 {
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 6px;
  color: var(--md-text);
}

.step-hint {
  font-size: 14px;
  color: var(--md-text-secondary);
  margin-bottom: 28px;
  line-height: 1.6;
}

/* ---- Step Navigation ---- */

.step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 32px;
  border-top: 1px solid var(--md-border);
}

.step-indicator {
  font-size: 13px;
  color: var(--md-text-secondary);
}

/* ---- Preview Panel ---- */

.preview-panel {
  width: 420px;
  background: var(--md-surface);
  border-left: 1px solid var(--md-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s ease;
}

.preview-panel.hidden {
  width: 0;
  overflow: hidden;
  border-left: none;
}

.preview-panel__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--md-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-panel__header h3 {
  font-size: 15px;
  font-weight: 500;
}

.preview-panel__content {
  padding: 24px 20px;
  overflow-y: auto;
  flex: 1;
  font-size: 13px;
  line-height: 1.7;
}

.preview-panel__content h1 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--md-primary);
}

.preview-panel__content .preview-meta {
  font-size: 12px;
  color: var(--md-text-secondary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--md-border);
}

.preview-panel__content h2 {
  font-size: 14px;
  font-weight: 500;
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--md-primary);
  padding-bottom: 4px;
  border-bottom: 2px solid var(--md-primary-light);
}

.preview-panel__content p {
  margin-bottom: 8px;
  color: var(--md-text);
}

.preview-panel__content .empty {
  color: #9aa0a6;
  font-style: italic;
}

.preview-panel__content blockquote {
  border-left: 3px solid var(--md-primary);
  padding-left: 12px;
  margin: 8px 0;
  color: var(--md-text-secondary);
  font-style: italic;
}

.preview-panel__content table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12px;
}

.preview-panel__content th,
.preview-panel__content td {
  border: 1px solid var(--md-border);
  padding: 6px 10px;
  text-align: left;
}

.preview-panel__content th {
  background: var(--md-background);
  font-weight: 500;
}

.preview-panel__content ul {
  padding-left: 18px;
  margin: 4px 0 8px;
}

.preview-panel__content li {
  margin-bottom: 2px;
}

/* ---- Dynamic List Items ---- */

.list-item {
  position: relative;
  padding-right: 36px;
  margin-bottom: 8px;
}

.remove-item {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--md-error);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  line-height: 1;
  opacity: 0.4;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s, background 0.15s;
}

.remove-item:hover {
  opacity: 1;
  background: #fce8e6;
}

/* ============================================
   Step List (editor.js pattern)
   ============================================ */

.step-list {
  list-style: none;
}

.step-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  font-size: 13px;
  color: var(--md-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
  user-select: none;
}

.step-list li:hover {
  background: var(--md-background);
}

.step-list li.active {
  color: var(--md-primary);
  font-weight: 500;
  background: var(--md-primary-light);
  border-left-color: var(--md-primary);
}

.step-list li.active .step-dot {
  background: var(--md-primary);
}

.step-list li.completed {
  color: var(--md-success);
}

.step-list li.completed .step-dot {
  background: var(--md-success);
}

/* ============================================
   Checkbox Group (editor pattern)
   ============================================ */

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 4px;
  margin-bottom: 8px;
}

.inline-other {
  margin-top: 8px;
}

.section-subtitle {
  font-size: 15px;
  font-weight: 500;
  color: var(--md-text);
  margin: 24px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--md-border);
}

/* ============================================
   Brief Card (complete styles)
   ============================================ */

.brief-card {
  background: var(--md-surface);
  border: 1px solid var(--md-border);
  border-radius: var(--md-radius);
  padding: 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.brief-card:hover {
  box-shadow: var(--md-shadow-2);
  border-color: transparent;
}

.brief-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.badge--draft {
  background: #fef7e0;
  color: #b36b00;
}

.badge--completed {
  background: #e6f4ea;
  color: var(--md-success);
}

.brief-card__brand {
  font-size: 13px;
  color: var(--md-text-secondary);
}

.brief-card__time {
  font-size: 12px;
  color: #9aa0a6;
  margin-top: auto;
}

/* ============================================
   Preview Content (editor pattern)
   ============================================ */

.preview-content {
  padding: 24px 20px;
  overflow-y: auto;
  flex: 1;
  font-size: 13px;
  line-height: 1.7;
}

.preview-content h1 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--md-primary);
}

.preview-content .preview-meta {
  font-size: 12px;
  color: var(--md-text-secondary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--md-border);
}

.preview-content h2 {
  font-size: 14px;
  font-weight: 500;
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--md-primary);
  padding-bottom: 4px;
  border-bottom: 2px solid var(--md-primary-light);
}

.preview-content p {
  margin-bottom: 8px;
  color: var(--md-text);
}

.preview-content .empty {
  color: #9aa0a6;
  font-style: italic;
}

.preview-content blockquote {
  border-left: 3px solid var(--md-primary);
  padding-left: 12px;
  margin: 8px 0;
  color: var(--md-text-secondary);
  font-style: italic;
}

.preview-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12px;
}

.preview-content th,
.preview-content td {
  border: 1px solid var(--md-border);
  padding: 6px 10px;
  text-align: left;
}

.preview-content th {
  background: var(--md-background);
  font-weight: 500;
}

.preview-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 11px;
  background: var(--md-primary-light);
  color: var(--md-primary);
  margin: 2px 4px 2px 0;
}

/* ============================================
   App Bar Left (dashboard pattern)
   ============================================ */

.app-bar__left {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ============================================
   Menu Header (dashboard pattern)
   ============================================ */

.md-menu__header {
  padding: 12px 16px;
}

.md-menu__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--md-text);
}

.md-menu__email {
  font-size: 12px;
  color: var(--md-text-secondary);
  margin-top: 2px;
}

/* ============================================
   Auth Logo
   ============================================ */

.auth-logo {
  margin-bottom: 16px;
}

.auth-card__header h1 {
  font-size: 24px;
  font-weight: 400;
  color: var(--md-text);
  margin-bottom: 8px;
}

.auth-card__header p {
  font-size: 14px;
  color: var(--md-text-secondary);
}

.auth-card__footer span {
  font-size: 14px;
  color: var(--md-text-secondary);
}

.auth-submit {
  width: 100%;
  margin-top: 8px;
  margin-bottom: 8px;
}

/* ============================================
   Button Danger (filled variant)
   ============================================ */

.md-btn--danger {
  background: var(--md-error);
  color: #fff;
}

.md-btn--danger:hover {
  background: #c5221f;
  box-shadow: var(--md-shadow-1);
}

/* ============================================
   Empty State (dashboard pattern)
   ============================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  animation: fadeIn 0.3s ease;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 500;
  color: var(--md-text);
  margin: 16px 0 8px;
}

.empty-state p {
  font-size: 14px;
  color: var(--md-text-secondary);
  margin-bottom: 24px;
}

/* ============================================
   Print styles
   ============================================ */

.print-only {
  display: none;
}

@media print {
  .app-bar,
  .step-sidebar,
  .form-area,
  .step-nav,
  .md-btn--fab {
    display: none !important;
  }

  .editor-layout {
    display: block;
    height: auto;
  }

  .preview-panel {
    display: none !important;
  }

  .print-only {
    display: block !important;
    padding: 40px;
    font-size: 13px;
    line-height: 1.8;
  }

  .print-only h1 {
    font-size: 22px;
    color: #333;
    margin-bottom: 4px;
  }

  .print-only .preview-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #eee;
  }

  .print-only h2 {
    font-size: 15px;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 10px;
    padding-bottom: 4px;
    border-bottom: 2px solid #eee;
  }

  .print-only table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
  }

  .print-only th,
  .print-only td {
    border: 1px solid #ddd;
    padding: 6px 10px;
    text-align: left;
  }

  .print-only th {
    background: #f5f5f5;
  }

  .print-only blockquote {
    border-left: 3px solid #999;
    padding-left: 12px;
    margin: 8px 0;
    color: #666;
    font-style: italic;
  }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1024px) {
  .preview-panel {
    display: none;
  }

  .preview-panel.visible-mobile {
    display: flex;
    position: fixed;
    top: 64px;
    right: 0;
    bottom: 0;
    width: 100%;
    z-index: 50;
  }

  .step-sidebar {
    width: 180px;
  }

  .form-area {
    padding: 24px;
  }

  .dashboard {
    padding: 16px;
  }

  .brief-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  .auth-card__header,
  .auth-card__body {
    padding-left: 24px;
    padding-right: 24px;
  }

  .auth-card__footer {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (max-width: 640px) {
  .step-sidebar {
    display: none;
  }

  .form-area {
    padding: 20px 16px;
  }

  .app-bar {
    padding: 0 12px;
    height: 56px;
  }

  .app-bar__title {
    font-size: 16px;
  }

  .md-btn--fab {
    bottom: 16px;
    right: 16px;
  }

  .brief-grid {
    grid-template-columns: 1fr;
  }

  .field-row {
    flex-direction: column;
    gap: 0;
  }

  .dashboard__header {
    flex-direction: column;
    align-items: stretch;
  }

  .search-bar {
    flex: 1;
  }

  .editor-layout {
    height: calc(100vh - 56px);
  }
}

/* ============================================
   Utility
   ============================================ */

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-secondary {
  color: var(--md-text-secondary);
}

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
