[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: #f4f5f7;
  color: #1f2937;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  transition: background 120ms ease, border-color 120ms ease, opacity 120ms ease;
}

.ai-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0 34px;
}

.ai-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.ai-header h1,
.card h2,
.drop-zone h2 {
  margin: 0;
}

.ai-header h1 {
  font-size: 25px;
}

.subtitle {
  max-width: 780px;
  margin: 8px 0 0;
  color: #667085;
  line-height: 1.5;
}

.eyebrow {
  margin: 0 0 5px;
  color: #667085;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-status {
  display: flex;
  gap: 8px;
  align-items: center;
}

.status-pill,
.model-pill {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill {
  border: 1px solid #d0d5dd;
  background: #f8fafc;
  color: #475467;
}

.status-pill.good {
  border-color: #a6d8bb;
  background: #edf9f1;
  color: #17633a;
}

.status-pill.bad {
  border-color: #f0b7b7;
  background: #fff1f1;
  color: #9f1d1d;
}

.model-pill {
  border: 1px solid #c7d7fe;
  background: #eff4ff;
  color: #3448a5;
}

.drop-panel,
.card,
.notice,
.result-banner {
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  background: #ffffff;
}

.drop-panel {
  padding: 12px;
  margin-bottom: 16px;
}

.drop-zone {
  display: grid;
  min-height: 205px;
  place-items: center;
  align-content: center;
  gap: 9px;
  padding: 24px;
  border: 1px dashed #b7c0cc;
  border-radius: 10px;
  background: #fbfcfe;
  text-align: center;
  cursor: pointer;
  outline: none;
}

.drop-zone:focus-visible,
.drop-zone.is-dragging {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.drop-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  background: #eef4ff;
  color: #2563eb;
  font-size: 26px;
  font-weight: 700;
}

.drop-zone p,
.plan-heading p,
.activity-panel p {
  margin: 0;
  color: #667085;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 16px;
}

.card {
  min-height: 340px;
  padding: 18px;
}

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

.primary-button,
.secondary-button,
.text-button {
  border-radius: 8px;
  cursor: pointer;
  font-weight: 650;
}

.primary-button {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid #1d4ed8;
  background: #2563eb;
  color: #ffffff;
}

.primary-button:hover:not(:disabled) {
  background: #1d4ed8;
}

.secondary-button {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #344054;
}

.secondary-button:hover:not(:disabled) {
  background: #f8fafc;
}

.text-button {
  padding: 4px 6px;
  border: 0;
  background: transparent;
  color: #475467;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.empty-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 24px;
  border: 1px solid #eef0f3;
  border-radius: 10px;
  background: #fafbfc;
  color: #667085;
  text-align: center;
}

.file-card {
  padding: 15px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #fafbfc;
}

.file-name {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.file-meta {
  margin: 6px 0 0;
  color: #667085;
  font-size: 13px;
}

.ai-options {
  margin-top: 14px;
}

.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
}

.toggle-row input {
  margin-top: 3px;
}

.toggle-row strong,
.toggle-row small {
  display: block;
}

.toggle-row small {
  margin-top: 3px;
  color: #667085;
  line-height: 1.4;
}

.activity-panel {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid #c7d7fe;
  border-radius: 10px;
  background: #f5f8ff;
}

.activity-panel p {
  margin-top: 3px;
  font-size: 13px;
}

.spinner {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 3px solid #dbe6ff;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

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

.plan-heading h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.plan-summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
  margin: 14px 0;
}

.plan-summary > div {
  padding: 11px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #fafbfc;
}

.metric-label {
  display: block;
  margin-bottom: 4px;
  color: #667085;
  font-size: 11px;
}

.warnings {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #f2cf86;
  border-radius: 10px;
  background: #fff9eb;
  color: #725016;
  font-size: 13px;
}

.warnings ul {
  margin: 7px 0 0;
  padding-left: 18px;
}

.plan-section {
  margin-top: 9px;
  padding: 12px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
}

.plan-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.plan-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid #f0f2f5;
  font-size: 13px;
}

.plan-control:first-of-type {
  border-top: 0;
}

.control-meta {
  display: block;
  margin-top: 2px;
  color: #7a8494;
  font-size: 11px;
}

.confidence {
  color: #667085;
  white-space: nowrap;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 16px;
}

.notice,
.result-banner {
  margin-top: 15px;
  padding: 13px 15px;
  color: #475467;
  font-size: 13px;
  line-height: 1.5;
}

.result-banner {
  display: flex;
  gap: 8px;
}

.result-banner.success {
  border-color: #a6d8bb;
  background: #edf9f1;
  color: #17633a;
}

.result-banner.error {
  border-color: #f0b7b7;
  background: #fff1f1;
  color: #8f1d1d;
}

@media (max-width: 820px) {
  .ai-header,
  .workspace-grid {
    display: block;
  }

  .header-status {
    margin-top: 12px;
  }

  .card + .card {
    margin-top: 16px;
  }
}
