/* Contract Redliner Tool Styles */

.contract-redliner-page { --accent: #ef4444; --accent2: #f97316; }
.contract-redliner-page .orb1 { width: 500px; height: 500px; top: -150px; right: -100px; background: rgba(239,68,68,0.08); }
.contract-redliner-page .orb2 { width: 400px; height: 400px; bottom: 5%; left: -100px; background: rgba(249,115,22,0.06); animation-delay: -7s; }

/* File drop zone */
.file-drop-zone {
  border: 2px dashed rgba(239,68,68,0.3);
  border-radius: 14px;
  padding: 40px 24px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
}
.file-drop-zone:hover,
.file-drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(239,68,68,0.05);
}
.file-drop-icon {
  width: 48px;
  height: 48px;
  color: var(--accent);
  margin: 0 auto 12px;
  opacity: 0.8;
}
.file-drop-text {
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 4px;
}
.file-drop-sub {
  color: var(--accent);
  font-weight: 600;
}
.file-drop-formats {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 8px;
}
.file-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(34,211,238,0.08);
  border: 1px solid rgba(34,211,238,0.2);
  border-radius: 10px;
}
.file-icon {
  width: 24px;
  height: 24px;
  color: var(--accent2);
  flex-shrink: 0;
  margin-right: 12px;
}
.file-name {
  flex: 1;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-remove {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(251,113,133,0.1);
  color: #fb7185;
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
}
.file-remove:hover {
  background: rgba(251,113,133,0.2);
  color: #fda4af;
}

/* Tool select */
.tool-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(0,0,0,0.35);
  color: var(--text);
  font-family: inherit;
  font-size: var(--text-base);
  transition: border-color 0.2s;
}
.tool-select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}

/* Progress */
.tool-progress {
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 14px;
  background: rgba(239,68,68,0.04);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.progress-title {
  font-weight: 600;
  color: var(--text);
}
.progress-step {
  font-size: 0.8125rem;
  color: var(--accent);
  font-weight: 500;
  font-family: var(--font-mono);
}
.progress-bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 999px;
  transition: width 0.5s ease;
}
.progress-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.progress-step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--muted);
  transition: color 0.2s;
}
.progress-step-item .step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 2px solid transparent;
  transition: all 0.3s;
}
.progress-step-item.active .step-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.progress-step-item.active {
  color: var(--accent);
  font-weight: 600;
}
.progress-step-item.completed .step-dot {
  background: #34d399;
  border-color: #34d399;
}
.progress-step-item.completed {
  color: #34d399;
}

/* Results */
.tool-result {
  animation: fadeInUp 0.4s ease;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.tool-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.2);
  flex-wrap: wrap;
  gap: 12px;
}
#resultTitle {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}
.tool-result-meta {
  font-size: 0.8125rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* Risk summary */
.risk-summary {
  padding: 20px 18px;
}
.risk-summary h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 16px;
}
.risk-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.risk-count {
  flex: 1;
  min-width: 80px;
  padding: 14px 10px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.risk-count.critical {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.2);
}
.risk-count.high {
  background: rgba(249,115,22,0.12);
  border-color: rgba(249,115,22,0.2);
}
.risk-count.medium {
  background: rgba(245,158,11,0.12);
  border-color: rgba(245,158,11,0.2);
}
.risk-count.low {
  background: rgba(34,211,238,0.12);
  border-color: rgba(34,211,238,0.2);
}
.risk-count.ok {
  background: rgba(52,211,153,0.12);
  border-color: rgba(52,211,153,0.2);
}
.risk-count-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}
.risk-count.critical .risk-count-value { color: #ef4444; }
.risk-count.high .risk-count-value { color: #f97316; }
.risk-count.medium .risk-count-value { color: #f59e0b; }
.risk-count.low .risk-count-value { color: #22d3ee; }
.risk-count.ok .risk-count-value { color: #34d399; }
.risk-count-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.risk-exposure {
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.15);
  font-size: 0.875rem;
  color: var(--text2);
  margin-bottom: 16px;
}
.exposure-note {
  display: block;
  font-size: 0.6875rem;
  color: var(--muted);
  margin-top: 6px;
}
.top-fixes h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text2);
}
.top-fixes ol {
  margin: 0;
  padding-left: 20px;
}
.top-fixes li {
  margin-bottom: 8px;
  line-height: 1.5;
  color: var(--text2);
}
.no-fixes {
  color: var(--muted);
  font-style: italic;
  margin: 0;
}

/* Clause table */
.clause-table {
  padding: 0 18px 18px;
}
.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
}
.redline-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.redline-table th {
  text-align: left;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.redline-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: top;
  line-height: 1.55;
}
.redline-table tr:last-child td {
  border-bottom: none;
}
.redline-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.risk-badge {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.risk-badge.critical { background: rgba(239,68,68,0.2); color: #ef4444; }
.risk-badge.high { background: rgba(249,115,22,0.2); color: #f97316; }
.risk-badge.medium { background: rgba(245,158,11,0.2); color: #f59e0b; }
.risk-badge.low { background: rgba(34,211,238,0.2); color: #22d3ee; }
.risk-badge.ok { background: rgba(52,211,153,0.2); color: #34d399; }

.no-change {
  color: var(--muted);
  font-style: italic;
  font-size: 0.8125rem;
}

/* Executive summary */
.result-section {
  margin-top: 24px;
  padding: 0 18px;
}
.result-section h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 16px;
}
#executiveSummarySection {
  padding: 20px;
  background: rgba(239,68,68,0.04);
  border: 1px solid rgba(239,68,68,0.1);
  border-radius: 12px;
  margin-top: 24px;
  line-height: 1.7;
  color: var(--text2);
}

/* Download button */
#downloadDocxBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Mobile */
@media (max-width: 640px) {
  .redline-table th:nth-child(3),
  .redline-table td:nth-child(3),
  .redline-table th:nth-child(4),
  .redline-table td:nth-child(4) {
    display: none;
  }
  .risk-counts { gap: 6px; }
  .risk-count { min-width: 60px; padding: 10px 6px; }
  .risk-count-value { font-size: 1.5rem; }
}