/* ═══════════════════════════════════════════════════════
   AI MALAYSIAN CORPORATE LAWYER — Full SaaS UI
   LexisNexis-inspired, Sidebar + Multi-view layout
═══════════════════════════════════════════════════════ */

/* ── TOKENS ── */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --bg-muted: #fbfbfd;
  --t1: #1d1d1f;
  --t2: #6e6e73;
  --t3: #aeaeb2;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --blue-press: #006edb;
  --blue-light: rgba(0, 113, 227, 0.10);
  --blue-ring: rgba(0, 113, 227, 0.25);
  --green: #34c759;
  --green-dark: #28a745;
  --red: #ff3b30;
  --orange: #ff9500;
  --border: rgba(0, 0, 0, 0.09);
  --border-md: rgba(0, 0, 0, 0.15);
  --border-focus: #0071e3;
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.10), 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.14), 0 8px 20px rgba(0, 0, 0, 0.06);
  --r-xs: 6px;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 18px;
  --r-xl: 22px;
  --r-pill: 980px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 0.12s;
  --t: 0.22s;
  --t-slow: 0.4s;
  --sidebar-w: 260px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--t1);
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.47;
  letter-spacing: -0.022em;
}

/* ═══════════════════════════════════════════════════════
   APP SHELL — sidebar + main
═══════════════════════════════════════════════════════ */
.app-shell {
  display: flex;
  height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: #fafafa;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease);
  z-index: 200;
}

.sidebar-header {
  padding: 18px 18px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

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

.brand-icon {
  font-size: 24px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--t1);
  letter-spacing: -0.03em;
}

.brand-sub {
  font-size: 10px;
  color: var(--t2);
  letter-spacing: 0.2px;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--t2);
  padding: 4px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--t3);
  letter-spacing: 1px;
  padding: 14px 12px 6px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--t2);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--t-fast) var(--ease);
  margin-bottom: 1px;
}

.nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--t1);
}

.nav-item.active {
  background: var(--blue-light);
  color: var(--blue);
  font-weight: 600;
}

.nav-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #6c5ce7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

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

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--t1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-plan {
  font-size: 10px;
  color: var(--t2);
}

.auth-buttons {
  display: flex;
  gap: 6px;
}

.auth-buttons .btn {
  flex: 1;
  font-size: 11px;
  padding: 6px 10px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 199;
}

/* ── MAIN AREA ── */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  height: 50px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  flex-shrink: 0;
  z-index: 50;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--t1);
  padding: 4px;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--t1);
  letter-spacing: -0.02em;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.api-status {
  font-size: 12px;
  color: var(--green-dark);
  font-weight: 500;
}

/* ── View content panels ── */
.view-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  background: var(--bg-muted);
}

.view-content.active {
  display: flex;
  flex-direction: column;
}

/* Step scroll container for the draft wizard */
.step-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 32px 28px 48px;
  scroll-behavior: smooth;
}

/* ═══════════════════════════════════════════════════════
   STEP INDICATOR
═══════════════════════════════════════════════════════ */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 10px 20px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.step-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--t3);
  transition: all var(--t) var(--ease);
  cursor: default;
  white-space: nowrap;
}

.step-dot.active {
  background: var(--blue-light);
  color: var(--blue);
}

.step-dot.completed {
  color: var(--green-dark);
}

.step-dot .num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  transition: all var(--t) var(--ease);
}

.step-dot.active .num {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 0 0 3px var(--blue-ring);
}

.step-dot.completed .num {
  background: var(--green);
  color: #fff;
}

.step-label {
  display: inline;
}

.step-connector {
  width: 20px;
  height: 1px;
  background: var(--border);
  margin: 0 1px;
  flex-shrink: 0;
}

/* ── Step panels ── */
.step-content {
  display: none;
  max-width: 1020px;
  margin: 0 auto;
  width: 100%;
  animation: slideUp var(--t-slow) var(--ease-out) both;
}

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

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--t1);
  margin-bottom: 6px;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.step-subtitle {
  font-size: 14px;
  color: var(--t2);
  margin-bottom: 28px;
  line-height: 1.6;
  max-width: 580px;
}

/* ═══════════════════════════════════════════════════════
   TYPE GRID
═══════════════════════════════════════════════════════ */
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.type-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 18px 18px;
  cursor: pointer;
  position: relative;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), transform var(--t) var(--ease-spring);
}

.type-card:hover {
  border-color: rgba(0, 113, 227, 0.3);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.type-card.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-ring), var(--shadow-sm);
}

.type-card.selected::after {
  content: '✓';
  position: absolute;
  top: 12px;
  right: 14px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.type-icon {
  font-size: 26px;
  margin-bottom: 8px;
  display: block;
}

.type-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--t1);
  margin-bottom: 4px;
}

.type-desc {
  font-size: 12px;
  color: var(--t2);
  line-height: 1.5;
  margin-bottom: 8px;
}

.type-statutes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.statute-tag {
  background: var(--bg-alt);
  color: var(--t2);
  border: 1px solid var(--border);
  font-size: 9px;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════
   UPLOAD
═══════════════════════════════════════════════════════ */
.upload-zone {
  background: var(--bg);
  border: 1.5px dashed var(--border-md);
  border-radius: var(--r-xl);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 16px;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease), transform var(--t) var(--ease-spring);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--blue);
  background: var(--blue-light);
  transform: scale(1.005);
}

.upload-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

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

.upload-subtext {
  font-size: 12px;
  color: var(--t2);
  margin-top: 3px;
}

.uploaded-files {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.file-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.2s var(--ease-out) both;
  box-shadow: var(--shadow-xs);
}

.file-item .file-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--t1);
}

.file-item .file-size {
  font-size: 11px;
  color: var(--t3);
}

.file-item .file-status {
  font-size: 11px;
  color: var(--green-dark);
  font-weight: 600;
}

.file-item .file-remove {
  background: none;
  border: none;
  color: var(--t3);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  transition: all var(--t-fast) var(--ease);
}

.file-item .file-remove:hover {
  background: rgba(255, 59, 48, 0.10);
  color: var(--red);
}

.upload-stats {
  font-size: 12px;
  color: var(--t3);
  padding: 4px 0;
}

/* ═══════════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════════ */
.form-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 22px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t) var(--ease);
}

.form-section:focus-within {
  box-shadow: var(--shadow-sm);
  border-color: var(--border-md);
}

.form-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--t2);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  margin-bottom: 12px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--t1);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--t1);
  font-family: inherit;
  outline: none;
  line-height: 1.5;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.form-control:hover {
  border-color: var(--border-md);
  background: var(--bg);
}

.form-control:focus {
  border-color: var(--border-focus);
  background: var(--bg);
  box-shadow: 0 0 0 3px var(--blue-ring);
}

.form-control::placeholder {
  color: var(--t3);
}

textarea.form-control {
  resize: vertical;
  min-height: 66px;
  line-height: 1.6;
}

.form-control-lg {
  font-size: 14px;
  padding: 10px 14px;
}

select.form-control {
  appearance: none;
  cursor: pointer;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%236e6e73' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.selected-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--blue-light);
  color: var(--blue);
  border: 1px solid rgba(0, 113, 227, 0.18);
  padding: 4px 14px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 18px;
}

/* ═══════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════ */
.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--r-pill);
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.01em;
  white-space: nowrap;
  user-select: none;
  transition: background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), transform var(--t) var(--ease-spring);
}

.btn:active {
  transform: scale(0.96) !important;
}

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

.btn-primary:hover {
  background: var(--blue-hover);
  box-shadow: 0 4px 16px rgba(0, 113, 227, 0.30);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(0, 0, 0, 0.05);
  color: var(--t1);
  border: 1px solid var(--border-md);
}

.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.09);
}

.btn-success {
  background: var(--green);
  color: #fff;
}

.btn-success:hover {
  background: var(--green-dark);
  box-shadow: 0 4px 16px rgba(52, 199, 89, 0.30);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--blue);
  border: none;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--r-sm);
}

.btn-ghost:hover {
  background: var(--blue-light);
}

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

.btn-outline:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.25);
}

.btn-sm {
  font-size: 12px;
  padding: 5px 12px;
}

.btn-lg {
  padding: 13px 30px;
  font-size: 15px;
}

.btn-block {
  width: 100%;
}

.btn-social {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-md);
  background: var(--bg);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  color: var(--t1);
  transition: all var(--t-fast) var(--ease);
}

.btn-social:hover {
  background: var(--bg-alt);
  box-shadow: var(--shadow-xs);
}

.btn-social img {
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
   GENERATION PROGRESS
═══════════════════════════════════════════════════════ */
.gen-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 70px 24px;
  gap: 18px;
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  position: relative;
}

.spinner::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
}

.spinner::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-top-color: var(--blue);
  border-right-color: rgba(0, 113, 227, 0.3);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.gen-status {
  font-size: 14px;
  color: var(--t2);
  font-weight: 500;
  animation: pulse 2.5s ease-in-out infinite;
  max-width: 360px;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.45;
  }
}

/* ── Executive Summary Panel ── */
.exec-summary-panel {
  background: linear-gradient(135deg, #f0f7ff 0%, #fff8f0 100%);
  border: 1.5px solid #c9d8f0;
  border-radius: var(--r-lg);
  padding: 24px 28px;
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.7;
}
.exec-summary-loading {
  color: var(--text-muted);
  font-size: 14px;
  padding: 12px 0;
}
.es-header {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #c9d8f0;
}
.es-section {
  margin-bottom: 18px;
}
.es-section:last-child {
  margin-bottom: 0;
}
.es-title {
  font-size: 13px;
  font-weight: 700;
  color: #2d4a7a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.es-body {
  color: #2c2c2c;
  font-size: 13.5px;
}
.es-list {
  margin: 0;
  padding-left: 18px;
  color: #2c2c2c;
  font-size: 13.5px;
}
.es-list li {
  margin-bottom: 6px;
}
.es-list.es-warnings li::marker {
  color: #d97706;
}
.es-list.es-warnings strong {
  color: #b45309;
}

.preview-container {
  background: #fff;
  color: #1c1c1c;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 40px 48px;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 13px;
  line-height: 1.85;
  white-space: pre-wrap;
  max-height: 50vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

/* ═══════════════════════════════════════════════════════
   EDITOR
═══════════════════════════════════════════════════════ */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 7px 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  flex-wrap: wrap;
}

.toolbar-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--t2);
  cursor: pointer;
  padding: 5px 9px;
  border-radius: var(--r-xs);
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  transition: all var(--t-fast) var(--ease);
}

.toolbar-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--t1);
}

.toolbar-sep {
  width: 1px;
  height: 18px;
  background: var(--border-md);
  margin: 0 5px;
  flex-shrink: 0;
}

.btn-regen {
  color: var(--blue) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  background: var(--blue-light) !important;
  border: 1px solid rgba(0, 113, 227, 0.2) !important;
  border-radius: var(--r-pill) !important;
  padding: 4px 12px !important;
}

.btn-regen:hover {
  background: rgba(0, 113, 227, 0.14) !important;
}

.editor-container {
  background: #fff;
  color: #1c1c1c;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  padding: 44px 56px;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 13pt;
  line-height: 1.9;
  min-height: 50vh;
  max-height: 60vh;
  overflow-y: auto;
  outline: none;
  text-align: justify;
  box-shadow: var(--shadow-sm);
}

.editor-container h1 {
  font-size: 16pt;
  font-weight: bold;
  margin: 22px 0 10px;
  text-align: center;
}

.editor-container h2 {
  font-size: 14pt;
  font-weight: bold;
  margin: 18px 0 8px;
}

.editor-container h3 {
  font-size: 13pt;
  font-weight: bold;
  margin: 14px 0 6px;
}

.editor-container p {
  margin: 6px 0;
}

/* ═══════════════════════════════════════════════════════
   EXPORT CARD
═══════════════════════════════════════════════════════ */
.export-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 48px 36px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
}

.export-icon {
  font-size: 56px;
  margin-bottom: 14px;
}

.export-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--t1);
  margin-bottom: 6px;
}

.export-meta {
  font-size: 13px;
  color: var(--t2);
  margin-bottom: 26px;
}

.export-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════
   AI CHAT
═══════════════════════════════════════════════════════ */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.chat-header h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.chat-header p {
  font-size: 13px;
  color: var(--t2);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-msg {
  display: flex;
  gap: 12px;
  max-width: 85%;
  animation: slideUp 0.2s var(--ease-out) both;
}

.chat-msg.bot {
  align-self: flex-start;
}

.chat-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border);
}

.chat-msg.user .chat-avatar {
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border: none;
}

.chat-bubble {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  font-size: 13.5px;
  line-height: 1.65;
  box-shadow: var(--shadow-xs);
}

.chat-msg.user .chat-bubble {
  background: var(--blue);
  color: #fff;
  border-color: transparent;
}

.chat-bubble p {
  margin: 6px 0;
}

.chat-bubble p:first-child {
  margin-top: 0;
}

.chat-bubble p:last-child {
  margin-bottom: 0;
}

.chat-bubble ul {
  margin: 6px 0;
  padding-left: 18px;
}

.chat-bubble li {
  margin: 3px 0;
  font-size: 13px;
}

.chat-input-area {
  padding: 16px 28px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.chat-input-wrap {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.chat-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--border-md);
  border-radius: var(--r-lg);
  padding: 11px 80px 11px 16px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  line-height: 1.5;
  max-height: 120px;
  background: var(--bg-alt);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.chat-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-ring);
  background: var(--bg);
}

.chat-voice {
  position: absolute;
  right: 44px;
  bottom: 8px;
  width: 30px;
  height: 30px;
  font-size: 14px;
}

.chat-send-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast) var(--ease);
}

.chat-send-btn:hover {
  background: var(--blue-hover);
}

.chat-suggestions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.suggestion-chip {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  font-size: 12px;
  color: var(--t2);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t-fast) var(--ease);
}

.suggestion-chip:hover {
  background: var(--blue-light);
  color: var(--blue);
  border-color: rgba(0, 113, 227, 0.2);
}

/* ═══════════════════════════════════════════════════════
   CONTRACT REVIEW / SUMMARIZE / TIMELINE
═══════════════════════════════════════════════════════ */
.review-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 28px 48px;
  width: 100%;
}

.review-result {
  margin-top: 24px;
}

.review-loading {
  text-align: center;
  padding: 40px 20px;
}

.review-loading p {
  font-size: 14px;
  color: var(--t2);
  margin-top: 14px;
  animation: pulse 2s ease-in-out infinite;
}

.review-output {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px 30px;
  font-size: 14px;
  line-height: 1.75;
  box-shadow: var(--shadow-sm);
}

.review-output h1,
.review-output h2,
.review-output h3 {
  color: var(--t1);
  margin: 18px 0 8px;
}

.review-output h2 {
  font-size: 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.review-output h3 {
  font-size: 15px;
}

.review-output ul {
  padding-left: 20px;
  margin: 8px 0;
}

.review-output li {
  margin: 4px 0;
}

.review-output .risk-high {
  color: var(--red);
  font-weight: 600;
}

.review-output .risk-medium {
  color: var(--orange);
  font-weight: 600;
}

.review-output .risk-low {
  color: var(--green-dark);
  font-weight: 600;
}

/* Timeline visual */
.timeline-visual {
  padding: 10px 0;
}

.timeline-item {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  border-left: 3px solid var(--blue);
  margin-left: 14px;
  padding-left: 20px;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 16px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--blue);
  border: 3px solid var(--bg);
}

.timeline-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  min-width: 100px;
  flex-shrink: 0;
}

.timeline-desc {
  font-size: 13.5px;
  color: var(--t1);
  line-height: 1.5;
}

/* Comparison */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 10px;
}

.compare-col h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--t1);
}

.compare-upload {
  padding: 36px 16px;
}

.compare-doc-name {
  font-size: 12px;
  color: var(--green-dark);
  font-weight: 500;
  margin-top: 6px;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════
   DOCUMENT VAULT
═══════════════════════════════════════════════════════ */
.vault-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 28px 48px;
  width: 100%;
}

.vault-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  align-items: center;
}

.vault-search {
  max-width: 360px;
}

.vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.vault-doc {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}

.vault-doc:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.vault-doc-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.vault-doc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--t1);
  margin-bottom: 4px;
  word-break: break-word;
}

.vault-doc-meta {
  font-size: 11px;
  color: var(--t3);
}

.vault-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 20px;
  color: var(--t2);
}

.vault-empty-icon {
  font-size: 48px;
  margin-bottom: 10px;
}

.vault-empty p {
  margin: 4px 0;
}

.text-muted {
  color: var(--t3);
  font-size: 13px;
}

.vault-premium-banner {
  margin-top: 20px;
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.06), rgba(108, 92, 231, 0.06));
  border: 1px solid rgba(0, 113, 227, 0.15);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.premium-badge {
  background: linear-gradient(135deg, var(--blue), #6c5ce7);
  color: #fff;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.vault-premium-banner p {
  flex: 1;
  font-size: 13px;
  color: var(--t1);
  min-width: 200px;
}

.premium-btns {
  display: flex;
  gap: 8px;
}

.premium-btns .btn {
  font-size: 12px;
}

.premium-btns img {
  vertical-align: middle;
  margin-right: 2px;
}

/* ═══════════════════════════════════════════════════════
   PRICING
═══════════════════════════════════════════════════════ */
.pricing-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 28px;
  text-align: center;
}

.pricing-hero-title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 8px;
}

.pricing-hero-sub {
  font-size: 16px;
  color: var(--t2);
  margin-bottom: 40px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  text-align: left;
}

.pricing-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 30px 24px;
  position: relative;
  transition: all var(--t) var(--ease);
}

.pricing-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pricing-card.featured {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-ring), var(--shadow-sm);
}

.pricing-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--blue);
  color: #fff;
  padding: 3px 14px;
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.pricing-plan-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--t1);
  margin-bottom: 12px;
}

.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-bottom: 4px;
}

.price-currency {
  font-size: 12px;
  color: var(--t2);
}

.price-amount {
  font-size: 40px;
  font-weight: 700;
  color: var(--t1);
  letter-spacing: -0.03em;
}

.price-period {
  font-size: 13px;
  color: var(--t2);
  margin-left: 2px;
}

.pricing-desc {
  font-size: 13px;
  color: var(--t2);
  margin-bottom: 20px;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.pricing-features li {
  padding: 6px 0;
  font-size: 13px;
  color: var(--t1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.pricing-features li:last-child {
  border-bottom: none;
}

.feat-disabled {
  color: var(--t3);
}

.pricing-faq {
  text-align: left;
  max-width: 680px;
  margin: 48px auto 0;
}

.pricing-faq h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-q {
  padding: 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-q::after {
  content: '+';
  font-size: 18px;
  color: var(--t3);
  transition: transform var(--t) var(--ease);
}

.faq-item.open .faq-q::after {
  content: '−';
}

.faq-a {
  max-height: 0;
  overflow: hidden;
  font-size: 13px;
  color: var(--t2);
  line-height: 1.6;
  transition: max-height 0.3s var(--ease), padding 0.3s var(--ease);
  padding: 0;
}

.faq-item.open .faq-a {
  max-height: 200px;
  padding: 0 0 16px;
}

/* ═══════════════════════════════════════════════════════
   AUTH MODAL
═══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.40);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.18s var(--ease-out);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: saturate(180%) blur(40px);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 32px;
  max-width: 440px;
  width: 92%;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.3s var(--ease-spring) both;
  position: relative;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.90) translateY(16px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--t1);
  margin-bottom: 6px;
}

.modal p {
  font-size: 13px;
  color: var(--t2);
  margin-bottom: 18px;
  line-height: 1.5;
}

.modal a {
  color: var(--blue);
  text-decoration: none;
}

.modal a:hover {
  text-decoration: underline;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--t3);
}

.auth-social {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 16px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  font-size: 11px;
  color: var(--t3);
  font-weight: 500;
  text-transform: uppercase;
}

.auth-switch {
  font-size: 13px;
  color: var(--t2);
  text-align: center;
  margin-top: 14px;
}

.auth-switch a {
  color: var(--blue);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════
   CLAUSE ADVISOR
═══════════════════════════════════════════════════════ */
.clause-advisor-wrap {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 4px;
}

.clause-question-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.clause-question-card:focus-within {
  box-shadow: 0 0 0 3px var(--blue-ring);
}

.clause-q-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.clause-q-icon {
  font-size: 16px;
}

.clause-q-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--t1);
  flex: 1;
}

.clause-q-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--t3);
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 8px;
  border-radius: 20px;
}

.clause-options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.clause-opt {
  position: relative;
  padding: 14px 16px;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.clause-opt:last-child {
  border-right: none;
}

.clause-opt:hover {
  background: var(--blue-light);
}

.clause-opt.selected {
  background: rgba(0, 113, 227, 0.08);
  border-bottom: 3px solid var(--blue);
}

.clause-opt-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.06);
  color: var(--t2);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  flex-shrink: 0;
}

.clause-opt.selected .clause-opt-badge {
  background: var(--blue);
  color: #fff;
}

.clause-opt-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.clause-opt-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--t1);
  line-height: 1.3;
}

.clause-opt-implication {
  display: none;
  font-size: 11px;
  color: var(--t2);
  line-height: 1.6;
  padding: 8px 10px;
  background: rgba(0, 113, 227, 0.05);
  border-radius: 8px;
  border-left: 3px solid var(--blue);
  margin-top: 3px;
}

.clause-opt.selected .clause-opt-implication {
  display: block;
}

.clause-opt-checkmark {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 14px;
  opacity: 0;
  color: var(--blue);
  transition: opacity var(--t-fast) var(--ease);
}

.clause-opt.selected .clause-opt-checkmark {
  opacity: 1;
}

.advisor-intro {
  font-size: 13px;
  color: var(--t2);
  margin-bottom: 18px;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════
   VOICE INPUT, SKIP LINK, TOAST, DISCLAIMER
═══════════════════════════════════════════════════════ */
.voice-group {
  position: relative;
}

.voice-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast) var(--ease);
  box-shadow: var(--shadow-xs);
  z-index: 2;
}

.voice-btn:hover {
  background: var(--blue-light);
  border-color: var(--blue);
  transform: scale(1.08);
}

.voice-btn.recording {
  background: rgba(255, 59, 48, 0.12);
  border-color: var(--red);
  animation: voicePulse 1s ease-in-out infinite;
}

@keyframes voicePulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.3);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(255, 59, 48, 0);
  }
}

.skip-link {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}

.skip-link:hover {
  text-decoration: underline;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(29, 29, 31, 0.92);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  transition: transform 0.35s var(--ease-spring);
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.disclaimer {
  background: rgba(255, 149, 0, 0.08);
  border: 1px solid rgba(255, 149, 0, 0.22);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-size: 12px;
  color: #7d4e00;
  margin-top: 16px;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════
   SCROLLBARS
═══════════════════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.22);
}

/* ═══════════════════════════════════════════════════════
   MOBILE / TABLET RESPONSIVE
═══════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: block;
  }

  .sidebar-overlay.active {
    display: block;
  }

  .hamburger {
    display: block;
  }

  .step-scroll {
    padding: 24px 20px 40px;
  }

  .editor-container {
    padding: 32px 28px;
  }

  .preview-container {
    padding: 32px 28px;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin: 0 auto;
  }

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

/* Phone */
@media (max-width: 768px) {
  .topbar {
    padding: 0 14px;
  }

  .topbar-title {
    font-size: 13px;
  }

  .step-indicator {
    padding: 8px 10px;
  }

  .step-dot {
    padding: 3px 6px;
    font-size: 11px;
  }

  .step-dot .num {
    width: 18px;
    height: 18px;
    font-size: 9px;
  }

  .step-label {
    display: none;
  }

  .step-connector {
    width: 12px;
  }

  .step-scroll {
    padding: 18px 12px 32px;
  }

  .step-title {
    font-size: 20px;
  }

  .step-subtitle {
    font-size: 13px;
    margin-bottom: 18px;
  }

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

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-section {
    padding: 16px 14px 12px;
  }

  .editor-container {
    padding: 20px 16px;
    font-size: 12pt;
    min-height: 40vh;
  }

  .preview-container {
    padding: 20px 16px;
    font-size: 12px;
  }

  .export-card {
    padding: 32px 18px;
  }

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

  .btn-row {
    flex-wrap: wrap;
  }

  .btn {
    padding: 10px 16px;
    flex: 1;
    justify-content: center;
    min-width: 80px;
  }

  .chat-messages {
    padding: 14px;
  }

  .chat-input-area {
    padding: 12px 14px 16px;
  }

  .chat-msg {
    max-width: 95%;
  }

  .clause-options-grid {
    grid-template-columns: 1fr;
  }

  .clause-opt {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .clause-opt:last-child {
    border-bottom: none;
  }

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

  .vault-search {
    max-width: 100%;
  }

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

  .vault-premium-banner {
    flex-direction: column;
    text-align: center;
  }

  .review-container {
    padding: 20px 14px 36px;
  }

  .vault-container {
    padding: 20px 14px 36px;
  }

  .pricing-container {
    padding: 28px 14px;
  }

  .pricing-hero-title {
    font-size: 26px;
  }
}

/* Phone portrait */
@media (max-width: 480px) {
  .topbar {
    height: 46px;
  }

  .form-control {
    font-size: 16px;
    padding: 10px 12px;
  }

  textarea.form-control {
    font-size: 16px;
  }

  .editor-container {
    padding: 14px 10px;
    font-size: 11pt;
  }

  .toolbar-btn {
    padding: 4px 6px;
    font-size: 12px;
  }

  .toolbar-sep {
    margin: 0 2px;
  }

  .upload-zone {
    padding: 32px 14px;
  }

  .voice-btn {
    width: 30px;
    height: 30px;
    font-size: 13px;
    right: 6px;
    bottom: 6px;
  }

  .chat-input {
    font-size: 16px;
  }

  .suggestion-chip {
    font-size: 11px;
    padding: 5px 10px;
  }
}

/* ═══════════════════════════════════════════════════════
   LEGAL ACADEMY VIEW
═══════════════════════════════════════════════════════ */
.academy-container {
  padding: 28px 32px 48px;
  max-width: 960px;
  margin: 0 auto;
}

.academy-hero {
  text-align: center;
  padding: 32px 0 24px;
  margin-bottom: 8px;
}
.academy-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(124,58,237,0.1);
  color: #7c3aed;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(124,58,237,0.2);
  margin-bottom: 16px;
}
.academy-hero-title {
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--t1);
  margin-bottom: 12px;
}
.academy-hero-sub {
  font-size: 15px;
  color: var(--t2);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.65;
}

/* Audience Switcher */
.academy-audience {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.audience-btn {
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--t2);
  cursor: pointer;
  transition: all .18s;
}
.audience-btn:hover { border-color: #aaa; color: var(--t1); }
.audience-btn.active {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
  box-shadow: 0 2px 10px rgba(124,58,237,0.3);
}

/* Timeline */
.academy-timeline-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
.academy-timeline-wrap::before {
  content: '';
  position: absolute;
  left: 27px;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #7c3aed 0%, rgba(124,58,237,0.1) 100%);
  z-index: 0;
}

.academy-stage {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0 20px;
  position: relative;
  margin-bottom: 32px;
}

.stage-connector-top,
.stage-connector-bottom { display: none; }

.stage-dot {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #0071e3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px #7c3aed, var(--shadow-md);
  align-self: flex-start;
  margin-top: 0;
}

.stage-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px 28px;
  transition: box-shadow .2s;
}
.stage-card:hover { box-shadow: var(--shadow-md); }

.stage-num {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7c3aed;
  margin-bottom: 4px;
}
.stage-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--t1);
  margin-bottom: 8px;
}
.stage-desc {
  font-size: 13.5px;
  color: var(--t2);
  line-height: 1.65;
  margin-bottom: 18px;
}

/* Stage Documents Grid */
.stage-docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stage-doc {
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px;
  cursor: pointer;
  transition: all .18s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stage-doc:hover {
  border-color: #7c3aed;
  background: rgba(124,58,237,0.04);
  box-shadow: var(--shadow-sm);
}
.stage-doc.recommended {
  border-color: rgba(52,199,89,0.5);
  background: rgba(52,199,89,0.04);
}
.stage-doc.recommended::after {
  content: '★ Recommended';
  font-size: 10px;
  font-weight: 700;
  color: #16a34a;
}
.sdoc-icon { font-size: 20px; }
.sdoc-name { font-size: 13px; font-weight: 700; color: var(--t1); }
.sdoc-why { font-size: 11.5px; color: var(--t2); line-height: 1.5; }
.sdoc-law { font-size: 10.5px; color: var(--t3); margin-top: 2px; }
.sdoc-btn {
  margin-top: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #7c3aed;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  transition: color .15s;
}
.sdoc-btn:hover { color: #0071e3; }

/* Stage warnings / tips */
.stage-warning {
  font-size: 12.5px;
  color: #b45309;
  background: rgba(255,149,0,0.08);
  border: 1px solid rgba(255,149,0,0.25);
  border-radius: var(--r);
  padding: 10px 14px;
  line-height: 1.55;
}
.stage-tip {
  font-size: 12.5px;
  color: #1d6936;
  background: rgba(52,199,89,0.08);
  border: 1px solid rgba(52,199,89,0.25);
  border-radius: var(--r);
  padding: 10px 14px;
  line-height: 1.55;
}

/* Academy CTA */
.academy-cta {
  text-align: center;
  background: linear-gradient(135deg, rgba(124,58,237,0.06) 0%, rgba(0,113,227,0.06) 100%);
  border: 1.5px solid rgba(124,58,237,0.2);
  border-radius: var(--r-xl);
  padding: 36px 32px;
  margin-top: 40px;
}
.academy-cta h3 { font-size: 22px; font-weight: 700; color: var(--t1); margin-bottom: 8px; }
.academy-cta p { font-size: 14px; color: var(--t2); }


/* ═══════════════════════════════════════════════════════
   DOCUMENT LIBRARY VIEW
═══════════════════════════════════════════════════════ */
.library-container {
  padding: 28px 32px 48px;
}

.library-hero {
  margin-bottom: 28px;
}
.library-search-wrap {
  margin-top: 18px;
  max-width: 560px;
}
.library-search {
  font-size: 15px;
  padding: 12px 16px;
  border-radius: var(--r-pill) !important;
}

/* Category Nav */
.lib-cats-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.lib-cat-btn {
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--t2);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.lib-cat-btn:hover { border-color: #aaa; color: var(--t1); }
.lib-cat-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* Doc Cards Grid */
.lib-docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.lib-doc-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all .18s;
}
.lib-doc-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(0,113,227,0.25);
  transform: translateY(-2px);
}
.lib-doc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.lib-doc-icon { font-size: 28px; }
.lib-doc-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--r-pill);
}
.badge-green { background: rgba(52,199,89,0.12); color: #16a34a; }
.badge-blue { background: rgba(0,113,227,0.10); color: var(--blue); }
.badge-purple { background: rgba(124,58,237,0.10); color: #7c3aed; }
.badge-orange { background: rgba(255,149,0,0.12); color: #d97706; }

.lib-doc-name { font-size: 15px; font-weight: 700; color: var(--t1); }
.lib-doc-law { font-size: 11.5px; color: var(--t3); }
.lib-doc-use {
  font-size: 12.5px;
  color: var(--t2);
  line-height: 1.55;
}
.lib-doc-when {
  font-size: 12px;
  color: var(--t2);
  background: var(--bg-alt);
  border-radius: var(--r);
  padding: 6px 10px;
}
.lib-doc-scenario {
  font-size: 12px;
  color: var(--t3);
  line-height: 1.5;
  font-style: italic;
}
.lib-doc-btn {
  margin-top: auto;
  padding-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  transition: color .15s;
}
.lib-doc-btn:hover { color: var(--blue-dark, #0058b4); }

.lib-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px;
  color: var(--t3);
  font-size: 15px;
}

/* Responsive Academy & Library */
@media (max-width: 768px) {
  .academy-container, .library-container {
    padding: 16px 16px 40px;
  }
  .academy-timeline-wrap::before { left: 23px; }
  .stage-dot { width: 46px; height: 46px; font-size: 18px; }
  .academy-stage { grid-template-columns: 46px 1fr; gap: 0 14px; }
  .stage-docs-grid { grid-template-columns: 1fr 1fr; }
  .lib-docs-grid { grid-template-columns: 1fr; }
  .lib-cats-nav { gap: 6px; }
}


/* ═══════════════════════════════════════════════
   MODE SELECTOR
   ═══════════════════════════════════════════════ */

.mode-selector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 30px 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.mode-card {
    background: var(--card-bg, #fff);
    border: 2px solid var(--border, #e2e8f0);
    border-radius: 16px;
    padding: 32px 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mode-card:hover {
    border-color: var(--primary, #4f46e5);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.15);
}

.mode-card.selected {
    border-color: var(--primary, #4f46e5);
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.04), rgba(139, 92, 246, 0.04));
    box-shadow: 0 8px 32px rgba(79, 70, 229, 0.2);
}

.mode-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.mode-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--dark, #1a202c);
}

.mode-desc {
    font-size: 14px;
    color: var(--t2, #718096);
    line-height: 1.6;
    margin-bottom: 16px;
}

.mode-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mode-features li {
    font-size: 13px;
    padding: 4px 0;
    color: var(--text, #4a5568);
}

.mode-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg, #f7fafc);
    color: var(--t2, #718096);
    margin-top: 16px;
}

.mode-tag.recommended {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
}

@media (max-width: 768px) {
    .mode-selector-grid { grid-template-columns: 1fr; gap: 16px; }
    .mode-card { padding: 24px 20px; }
}

/* ═══════════════════════════════════════════════
   CHAT WIZARD
   ═══════════════════════════════════════════════ */

.chat-wizard-container {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 16px;
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: 500px;
    overflow: hidden;
}

.chat-wizard-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    scroll-behavior: smooth;
}

.wizard-msg {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    animation: wizFadeIn 0.3s ease;
}

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

.wizard-msg.user {
    justify-content: flex-end;
}

.wizard-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.wizard-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.wizard-msg.bot .wizard-bubble {
    background: var(--bg, #f7fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-bottom-left-radius: 4px;
    color: var(--dark, #1a202c);
}

.wizard-msg.user .wizard-bubble {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border-bottom-right-radius: 4px;
}

.wizard-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 24px;
    margin-bottom: 16px;
    animation: wizFadeIn 0.4s ease;
}

.wizard-pill {
    padding: 8px 16px;
    border: 1.5px solid var(--border, #e2e8f0);
    background: var(--card-bg, #fff);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--dark, #1a202c);
}

.wizard-pill:hover {
    border-color: var(--primary, #4f46e5);
    background: rgba(79, 70, 229, 0.06);
    transform: translateY(-1px);
}

.wizard-pill.active {
    background: var(--primary, #4f46e5);
    color: white;
    border-color: var(--primary, #4f46e5);
}

.wizard-actions {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    justify-content: center;
    animation: wizFadeIn 0.4s ease;
}

.chat-wizard-input-area {
    display: flex;
    gap: 10px;
    padding: 16px;
    border-top: 1px solid var(--border, #e2e8f0);
    background: var(--bg, #f7fafc);
}

.chat-wizard-input-area .form-control {
    flex: 1;
}

/* ═══════════════════════════════════════════════
   UPLOAD EXISTING AGREEMENT
   ═══════════════════════════════════════════════ */

.existing-upload-section {
    margin-top: 24px;
}

.section-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
    color: var(--t3, #a0aec0);
    font-size: 13px;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border, #e2e8f0);
}

.upload-existing-zone {
    border: 2px dashed var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(79, 70, 229, 0.02);
}

.upload-existing-zone:hover {
    border-color: var(--primary, #4f46e5);
    background: rgba(79, 70, 229, 0.05);
}

.optional-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg, #f0f0f0);
    border-radius: 8px;
    font-size: 11px;
    color: var(--t2, #718096);
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}

.existing-preview {
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--bg, #f7fafc);
    border-radius: 10px;
    border: 1px solid var(--border, #e2e8f0);
}

.existing-preview-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.existing-file-icon {
    font-size: 24px;
}

/* ═══════════════════════════════════════════════
   MY DOCUMENTS FOLDER
   ═══════════════════════════════════════════════ */

.vault-toolbar-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

.view-toggle {
    display: flex;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    overflow: hidden;
}

.view-toggle-btn {
    padding: 6px 10px;
    background: var(--card-bg, #fff);
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.view-toggle-btn.active {
    background: var(--primary, #4f46e5);
    color: white;
}

.folder-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.folder-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--t2, #718096);
}

.breadcrumb-item {
    cursor: pointer;
    font-weight: 500;
}

.breadcrumb-item.active {
    color: var(--dark, #1a202c);
}

.folder-tabs {
    display: flex;
    gap: 4px;
}

.folder-tab {
    padding: 6px 14px;
    border: 1px solid var(--border, #e2e8f0);
    background: var(--card-bg, #fff);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--t2, #718096);
}

.folder-tab.active {
    background: var(--primary, #4f46e5);
    color: white;
    border-color: var(--primary, #4f46e5);
}

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

.my-docs-grid.list-view {
    grid-template-columns: 1fr;
}

.doc-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.doc-card:hover {
    border-color: var(--primary, #4f46e5);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.doc-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.doc-card-icon {
    font-size: 32px;
}

.doc-card-star {
    border: none;
    background: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.3;
    transition: opacity 0.2s;
}

.doc-card-star.starred {
    opacity: 1;
}

.doc-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark, #1a202c);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-card-meta {
    font-size: 12px;
    color: var(--t3, #a0aec0);
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.doc-card-type {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary, #4f46e5);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.doc-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border, #e2e8f0);
}

.doc-card-actions .btn {
    font-size: 11px;
    padding: 4px 10px;
}

/* List view cards */
.my-docs-grid.list-view .doc-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
}

.my-docs-grid.list-view .doc-card-header {
    margin-bottom: 0;
}

.my-docs-grid.list-view .doc-card-icon {
    font-size: 24px;
}

.my-docs-grid.list-view .doc-card-actions {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
    margin-left: auto;
}

.my-docs-empty {
    text-align: center;
    padding: 60px 20px;
}

.my-docs-empty .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.my-docs-empty h3 {
    color: var(--dark, #1a202c);
    margin-bottom: 8px;
}

.my-docs-empty p {
    color: var(--t2, #718096);
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .my-docs-grid { grid-template-columns: 1fr 1fr; }
    .vault-toolbar { flex-direction: column; gap: 10px; }
    .vault-toolbar-right { width: 100%; }
    .folder-nav { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    .my-docs-grid { grid-template-columns: 1fr; }
}


/* ═══════════════════════════════════════════════
   WELCOME ONBOARDING OVERLAY
   ═══════════════════════════════════════════════ */

.welcome-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 15, 35, 0.92);
    backdrop-filter: blur(12px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.welcome-card {
    background: white;
    border-radius: 20px;
    padding: 48px 40px;
    max-width: 520px;
    width: 90%;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0,0,0,0.3);
    animation: slideUp 0.5s ease;
}

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

.welcome-icon { font-size: 56px; margin-bottom: 16px; }
.welcome-title { font-size: 28px; font-weight: 800; color: #1a202c; margin: 0 0 8px; }
.welcome-sub { font-size: 15px; color: #4f46e5; font-weight: 600; margin: 0 0 16px; }
.welcome-desc { font-size: 14px; color: #718096; line-height: 1.7; margin-bottom: 24px; }

.welcome-features {
    display: grid;
    gap: 8px;
    margin-bottom: 24px;
}

.welcome-feat {
    font-size: 13px;
    padding: 8px 14px;
    background: #f7fafc;
    border-radius: 8px;
    color: #4a5568;
    text-align: left;
}

.welcome-terms {
    margin-bottom: 20px;
}

.welcome-checkbox {
    font-size: 13px;
    color: #718096;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.welcome-checkbox input { cursor: pointer; }
.welcome-checkbox a { color: #4f46e5; text-decoration: underline; }

.welcome-company {
    font-size: 11px;
    color: #a0aec0;
    margin-top: 16px;
}

/* T&C Banner */
.tc-banner {
    position: fixed;
    bottom: 0;
    left: 0; right: 0;
    background: #fffbeb;
    border-top: 1px solid #fbbf24;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 999;
    font-size: 13px;
    color: #92400e;
}

.tc-banner a { color: #4f46e5; }


/* ═══════════════════════════════════════
   FEEDBACK WIDGET
   ═══════════════════════════════════════ */

.feedback-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(124,58,237,0.4);
    z-index: 9000;
    transition: transform 0.2s, box-shadow 0.2s;
}
.feedback-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(124,58,237,0.5);
}

.feedback-widget {
    position: fixed;
    bottom: 88px;
    right: 24px;
    width: 340px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.04);
    z-index: 9001;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.feedback-widget-header {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.feedback-widget-body {
    padding: 16px;
}

.feedback-stars {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 14px;
}

.fb-star {
    font-size: 28px;
    cursor: pointer;
    color: #94a3b8;
    transition: transform 0.2s;
}
.fb-star:hover { transform: scale(1.2); }


/* ═══════════════════════════════════════
   DOCUMENT LIBRARY CARDS
   ═══════════════════════════════════════ */

.lib-doc-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: white;
    border: 1px solid var(--b1, #e2e8f0);
    border-radius: 12px;
    transition: all 0.2s;
    margin-bottom: 8px;
}
.lib-doc-card:hover {
    border-color: var(--p1, #4f46e5);
    box-shadow: 0 4px 16px rgba(79,70,229,0.08);
    transform: translateY(-1px);
}
.lib-doc-icon { font-size: 32px; min-width: 44px; text-align: center; }
.lib-doc-info { flex: 1; }
.lib-doc-name { font-size: 15px; font-weight: 700; color: var(--t1, #1a202c); margin-bottom: 3px; }
.lib-doc-desc { font-size: 13px; color: var(--t2, #64748b); margin-bottom: 4px; }
.lib-doc-law { font-size: 11px; color: var(--p1, #4f46e5); font-weight: 600; background: rgba(79,70,229,0.08); padding: 2px 8px; border-radius: 4px; }
.lib-doc-actions { display: flex; gap: 6px; }
.btn-sm { padding: 6px 12px !important; font-size: 12px !important; }

/* ═══════════════════════════════════════
   SAMPLE DOCUMENT PREVIEW MODAL
   ═══════════════════════════════════════ */

.preview-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.preview-modal {
    background: white;
    border-radius: 16px;
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0,0,0,0.2);
}

.preview-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    background: white;
    border-radius: 16px 16px 0 0;
    z-index: 1;
}

.preview-modal-body {
    padding: 24px;
}

.preview-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Document Preview Styles */
.preview-doc {
    font-family: 'Times New Roman', Georgia, serif;
    color: #1a202c;
}

.preview-header {
    text-align: center;
    border-bottom: 2px solid #1a202c;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.preview-header h3 {
    font-size: 20px;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.preview-parties {
    font-size: 13px;
    color: #4a5568;
}

.preview-body {
    font-size: 14px;
    line-height: 1.8;
}

.preview-clause {
    margin-top: 16px;
    margin-bottom: 6px;
}

.redacted {
    background: #fef3c7;
    color: #92400e;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    border: 1px dashed #f59e0b;
}

/* ═══════════════════════════════════════
   ENHANCED EDUCATIONAL MODAL
   ═══════════════════════════════════════ */

.edu-section {
    margin-bottom: 24px;
}

.edu-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.edu-list {
    padding-left: 0;
    list-style: none;
}

.edu-list li {
    font-size: 13px;
    color: #4a5568;
    padding: 6px 0 6px 20px;
    position: relative;
    line-height: 1.6;
}

.edu-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #4f46e5;
    font-weight: 700;
}

.edu-mistake-list li::before {
    content: '⚠️';
}

.edu-cost-badge {
    display: inline-block;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}


/* ═══════════════════════════════════════
   USER ACCOUNT MODAL
   ═══════════════════════════════════════ */

.account-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: #f7fafc;
    border-radius: 10px;
    padding: 4px;
}
.account-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s;
}
.account-tab.active {
    background: white;
    color: #4f46e5;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.account-panel { display: none; }
.account-panel.active { display: block; }

.subscription-card {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-radius: 14px;
    padding: 24px;
    color: white;
}
.subscription-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.subscription-details {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 12px;
    margin-top: 16px;
}
.sub-detail { font-size: 12px; }
.sub-detail span { display: block; opacity: 0.7; margin-bottom: 2px; }
.sub-detail strong { font-size: 14px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ═══════════════════════════════════════
   CLIENT MANAGEMENT
   ═══════════════════════════════════════ */

.clients-container { padding: 4px 0; }
.clients-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.clients-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.client-tab {
    padding: 8px 16px;
    border: 1px solid var(--b1, #e2e8f0);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s;
}
.client-tab.active { background: #4f46e5; color: white; border-color: #4f46e5; }
.clients-search { margin-bottom: 16px; }

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

.client-card {
    background: white;
    border: 1px solid var(--b1, #e2e8f0);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
}
.client-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); border-color: #4f46e5; }
.client-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.client-name { font-size: 16px; font-weight: 700; }
.client-company { font-size: 13px; color: #64748b; }
.client-status { font-size: 12px; font-weight: 600; white-space: nowrap; }
.client-details { margin-bottom: 12px; }
.client-detail { font-size: 12px; color: #64748b; margin-bottom: 3px; }
.client-progress { margin-bottom: 14px; }
.progress-label { font-size: 11px; color: #94a3b8; font-weight: 600; margin-bottom: 4px; }
.progress-bar-wrap { height: 6px; background: #f1f5f9; border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, #4f46e5, #7c3aed); border-radius: 3px; transition: width 0.3s; }
.client-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.empty-clients { text-align: center; padding: 60px 20px; color: #64748b; }
.empty-clients h3 { font-size: 20px; color: #1a202c; margin-bottom: 8px; }
.empty-clients p { font-size: 14px; margin-bottom: 16px; }

/* ═══════════════════════════════════════
   LEGAL DISCLAIMER FOOTER
   ═══════════════════════════════════════ */

.legal-disclaimer-footer {
    background: #1a1a2e;
    padding: 16px 24px;
    text-align: center;
}
.legal-disclaimer-footer p {
    font-size: 12px;
    color: #94a3b8;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}
.legal-disclaimer-footer strong { color: #f59e0b; }
