/* Site-specific styles for pdf-to-markdown. Shared chrome (vars, base reset,
 * .btn, .topbar, .status, .footer) lives in /_chrome.css and is loaded ahead
 * of this file. */

.pill {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ok, #1faa6e) 18%, transparent);
  color: var(--ok, #4cb98a);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  vertical-align: middle;
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-areas:
    "upload rail"
    "result result";
  gap: 16px;
  padding: 16px;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 880px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "upload"
      "rail"
      "result";
  }
}

.upload {
  grid-area: upload;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 36px 24px;
  background: var(--bg-pane);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  outline: none;
}
.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--accent, #6aa9ff);
}
.dropzone.dragover {
  border-color: var(--accent, #6aa9ff);
  background: color-mix(in srgb, var(--accent, #6aa9ff) 10%, var(--bg-pane));
}
.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.dropzone-headline {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}
.dropzone-hint {
  margin: 0;
  max-width: 460px;
  color: var(--fg-mute);
  font-size: 13px;
  line-height: 1.5;
}

.options {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 8px 4px 0;
}
.opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-mute);
  user-select: none;
}
.opt code {
  font-family: var(--mono);
  font-size: 12px;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--bg-elev);
}

.rail {
  grid-area: rail;
  min-width: 0;
}
.ad-slot {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-pane);
  padding: 16px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-placeholder {
  margin: 0;
  color: var(--fg-mute);
  font-size: 12px;
  text-align: center;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.result {
  grid-area: result;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-pane);
  overflow: hidden;
}
.result[hidden] {
  display: none;
}
.result-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.result-head h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.2px;
}
.result-meta {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--fg-mute);
  font-family: var(--mono);
}
.result-grid {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 0;
  min-height: 340px;
}
@media (max-width: 700px) {
  .result-grid {
    grid-template-columns: 1fr;
  }
}
.file-list {
  margin: 0;
  padding: 8px 0;
  list-style: none;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  max-height: 60vh;
}
.file-list li {
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 3px solid transparent;
  color: var(--fg);
}
.file-list li.active {
  background: var(--bg-elev);
  border-left-color: var(--accent, #6aa9ff);
}
.file-list .file-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-list .file-sub {
  font-size: 11px;
  color: var(--fg-mute);
  font-family: var(--mono);
}
.file-list li.error .file-name {
  color: var(--err, #e07a7a);
}

.preview {
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  background: var(--bg-pane);
  color: var(--fg);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 60vh;
  min-height: 240px;
}

.result-cta {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr);
  gap: 14px;
  padding: 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-pane);
}
@media (max-width: 720px) {
  .result-cta {
    grid-template-columns: 1fr;
  }
}
.cta-block {
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.cta-headline {
  margin: 0 0 4px;
  font-weight: 600;
  font-size: 13px;
}
.cta-body {
  margin: 0;
  color: var(--fg-mute);
  font-size: 12.5px;
  line-height: 1.5;
}
.cta-body a {
  color: var(--accent, #6aa9ff);
  text-decoration: none;
  white-space: nowrap;
}
.cta-body a:hover {
  text-decoration: underline;
}
.ai-handoff {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.ai-label {
  font-size: 13px;
  font-weight: 600;
}
.ai-note {
  font-size: 11.5px;
  color: var(--fg-mute);
  flex-basis: 100%;
}
