:root {
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --page-bg: #f7f7f8;
  --card-bg: #ffffff;
  --border: #e3e3e6;
  --text: #1a1a1a;
  --text-secondary: #6b6b70;
  --text-muted: #9a9a9e;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--page-bg);
  padding: 16px;
  width: 100%;
  margin: 0;
}

h1 {
  font-size: 16px;
  margin: 0 0 2px;
}

.subtitle {
  color: var(--text-secondary);
  margin: 0 0 18px;
}

h2 {
  font-size: 13px;
  margin: 0 0 10px;
}

.card {
  background: var(--card-bg);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 10px rgba(0, 0, 0, 0.05);
}

textarea, input[type="file"] {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fafafa;
  margin-bottom: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
  background: #fff;
}

.hint {
  font-size: 11px;
  color: var(--text-muted);
  margin: -2px 0 8px;
}

.or {
  color: var(--text-muted);
  font-size: 12px;
  margin: 6px 0;
}

button {
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  transition: background 0.15s, transform 0.1s;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary:disabled {
  background: #c7c7cc;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

.status {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.status.error {
  color: #b3261e;
}

.stepper {
  display: flex;
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 0 4px;
}

.step-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.step-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}

.step-wrap:hover .step-label {
  color: var(--accent);
}

.step-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
}

.step-label.active, .step-label.done {
  color: var(--accent);
  font-weight: 700;
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 10px 6px 0;
  transition: background 0.3s;
  align-self: flex-start;
}

.step-line.done {
  background: var(--accent);
}

/* Only one step panel is visible at a time — see goToStep() in sidepanel.js.
   This is what structurally eliminates the accidental-overwrite bug: Step 1's
   inputs simply aren't in the DOM's visible/interactive state while Step 2 or
   3 is active, so there's no hidden-but-live control to trigger by mistake. */
.step-panel {
  display: none;
}

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

.step-panel.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: -4px;
  background: rgba(79, 70, 229, 0.04);
}

.claims-preview {
  margin: 10px 0;
}

.claims-preview .claim {
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: none;
}

.next-btn {
  margin-top: 12px;
}

.next-btn:disabled {
  background: #c7c7cc;
  cursor: not-allowed;
}

.step-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.step-nav .next-btn {
  flex: 1;
  margin-top: 0;
}

.step-nav-top {
  margin-top: 0;
  margin-bottom: 14px;
}

.btn-secondary {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
}

.btn-secondary:hover {
  background: #f2f2f4;
}

#gateView button {
  margin-bottom: 8px;
}

#planSelectionView h2 {
  font-size: 15px;
  margin-bottom: 4px;
}

.plan-card {
  background: var(--card-bg);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 10px rgba(0, 0, 0, 0.05);
}

.plan-card h3 {
  font-size: 14px;
  margin: 0 0 2px;
}

.plan-card .plan-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

.plan-card .plan-price span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.plan-card ul {
  margin: 0 0 10px;
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-secondary);
}

.plan-card li {
  margin-bottom: 2px;
}

#enterpriseCard {
  text-align: center;
}

#accountStatusBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
}

#accountStatusBar .hint {
  margin: 0;
}

.document-list {
  margin-bottom: 8px;
}

.document-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  background: #fafafa;
}

.document-item .doc-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-item .doc-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  flex-shrink: 0;
}

.document-item .doc-remove:hover {
  color: #b3261e;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}

.link-btn:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.plan-selection-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.account-avatar-wrap,
.account-help-wrap {
  position: relative;
}

.account-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.account-avatar:hover {
  background: var(--accent-hover);
}

.account-help-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.account-help-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.account-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 190px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  padding: 6px;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.account-menu-right {
  left: auto;
  right: 0;
}

.account-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
}

.account-menu-item:hover {
  background: var(--page-bg);
}

.account-menu-item-danger {
  color: #b3261e;
}

.account-menu-item-danger:hover {
  background: #fdecea;
}

.upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.claim {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--card-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 10px rgba(0, 0, 0, 0.05);
}

.claim-text {
  font-weight: 600;
  margin-bottom: 8px;
}

.verdict-badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
}

.verdict-Supported { background: #e3f5ea; color: #1c7a44; }
.verdict-Partially-Supported { background: #eef6df; color: #4d7a1c; }
.verdict-Ambiguous { background: #f1f1f3; color: #5b5b60; }
.verdict-Contradicted { background: #fdeaea; color: #b3261e; }
.verdict-No-Evidence-Found { background: #fdf1e0; color: #9a5b13; }

.quote {
  font-style: italic;
  color: #444;
  background: #fafafa;
  padding: 8px 10px;
  border-radius: 8px;
  margin: 6px 0;
  font-size: 12px;
}

.evidence {
  color: var(--text-secondary);
  font-size: 11.5px;
}

.page-tag {
  color: var(--text-muted);
  font-size: 11px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  z-index: 100;
  overflow-y: auto;
}

.modal-panel {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px 18px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modal-header h2 {
  margin: 0;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
}

.modal-close-btn:hover {
  color: var(--text);
}

.plan-card-current {
  border-color: var(--accent);
  border-width: 2px;
}

.plan-card-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(79, 70, 229, 0.1);
  border-radius: 4px;
  padding: 2px 6px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Web-app-only addition below this line — everything above is copied
   verbatim from extension/sidepanel.css unmodified, so the two never drift
   apart in the styling they share. The extension's own body has no width
   constraint since a side panel is already narrow by construction; a real
   browser tab isn't, so this keeps the exact same proven layout as a
   centered column instead of stretching it edge-to-edge on a wide window. */
body {
  max-width: 480px;
  margin: 0 auto;
}
