.pdf-case {
  margin-top: 26px;
  padding: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-card);
}

.pdf-case h2 {
  margin: 0 0 10px;
  color: var(--green);
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.pdf-case-grid {
  display: grid;
  grid-template-columns: 0.9fr 0.78fr 1.32fr;
  gap: 16px;
  margin-top: 28px;
}

.drive-panel,
.pipeline-panel,
.sheet-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e7e0d8;
  border-radius: 18px;
  background: #fcfbf9;
}

.drive-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid #e7e0d8;
  background: #f7f4ef;
  color: #5e5953;
  font-size: 12px;
  font-weight: 700;
}

.drive-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d8d0c7;
}

.drive-body {
  min-height: 370px;
  padding: 14px;
}

.drive-folder {
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid #e5ddd4;
  border-radius: 13px;
  background: #ffffff;
}

.drive-folder-title {
  padding: 11px 12px;
  border-bottom: 1px solid #eee7df;
  background: #fbfaf7;
  color: #46413d;
  font-family: var(--font-tech);
  font-size: 10px;
  font-weight: 600;
}

.drive-files {
  min-height: 54px;
  padding: 8px;
}

.drive-empty {
  padding: 10px;
  color: #a09a93;
  font-family: var(--font-tech);
  font-size: 9px;
  text-align: center;
}

.drive-file {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #56514c;
  font-family: var(--font-tech);
  font-size: 9px;
  line-height: 1.35;
  transition:
    opacity 0.2s ease,
    transform 0.25s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.drive-file:last-child {
  margin-bottom: 0;
}

.drive-file.processing {
  border-color: #efd28a;
  background: #fff7e5;
  transform: translateX(3px);
}

.drive-file.archived {
  border-color: #d2e3d6;
  background: #f3f8f4;
}

.pdf-icon {
  display: grid;
  width: 27px;
  height: 32px;
  place-items: center;
  border-radius: 5px;
  background: #c6534f;
  color: #ffffff;
  font-size: 7px;
  font-weight: 700;
}
.pipeline-body {
  min-height: 370px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pipeline-step {
  position: relative;
  padding: 12px 12px 12px 42px;
  border: 1px solid #e5ddd4;
  border-radius: 12px;
  background: #ffffff;
  color: #68615a;
  font-size: 11px;
  font-weight: 700;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.pipeline-step + .pipeline-step {
  margin-top: 17px;
}

.pipeline-step + .pipeline-step::before {
  content: "↓";
  position: absolute;
  top: -18px;
  left: 50%;
  color: #aaa198;
  font-family: var(--font-tech);
  transform: translateX(-50%);
}

.pipeline-step span {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ece7e0;
  color: #827a72;
  font-family: var(--font-tech);
  font-size: 9px;
  transform: translateY(-50%);
}

.pipeline-step.active {
  border-color: #efd28a;
  background: #fff7e5;
  color: #725400;
  transform: translateX(2px);
}

.pipeline-step.done {
  border-color: #cfe0d3;
  background: #f3f8f4;
  color: var(--green);
}

.pipeline-step.done span {
  background: var(--green);
  color: #ffffff;
}

.sheet-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 12px 0;
  border-bottom: 1px solid #e7e0d8;
  background: #f7f4ef;
}

.sheet-tab {
  padding: 8px 11px;
  border: 1px solid #ddd5cc;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  background: #eee9e3;
  color: #7b746c;
  font-family: var(--font-tech);
  font-size: 9px;
  cursor: pointer;
}

.sheet-tab.active {
  background: #ffffff;
  color: var(--green);
  font-weight: 700;
}

.pdf-sheet-window {
  height: 370px;
  overflow: auto;
  background: #ffffff;
}

.pdf-result-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.pdf-result-table th,
.pdf-result-table td {
  padding: 9px 8px;
  border-right: 1px solid #eee8e0;
  border-bottom: 1px solid #eee8e0;
  text-align: left;
  vertical-align: top;
  font-size: 9px;
  line-height: 1.35;
}

.pdf-result-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7f4ef;
  color: #5f5953;
  font-weight: 700;
}

.pdf-result-table td {
  color: #514c47;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.pdf-result-table tr.show td {
  opacity: 1;
  transform: translateY(0);
}
.pdf-case-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--border-blue);
  border-radius: 16px;
  background: #f1f6f9;
}

.pdf-log {
  min-height: 42px;
  color: #50616a;
  font-family: var(--font-tech);
  font-size: 10px;
  line-height: 1.55;
}

.pdf-run-button {
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(47, 111, 159, 0.18);
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.pdf-run-button:hover {
  background: var(--blue-hover);
  transform: translateY(-1px);
}

.pdf-run-button:disabled {
  opacity: 0.62;
  cursor: wait;
  transform: none;
}

.pdf-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.pdf-summary-item {
  padding: 14px 12px;
  border: 1px solid #e8e2da;
  border-radius: 14px;
  background: #fcfbf9;
  text-align: center;
}

.pdf-summary-item strong {
  display: block;
  color: var(--blue);
  font-family: var(--font-tech);
  font-size: 18px;
  line-height: 1;
}

.pdf-summary-item span {
  display: block;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.35;
}

@media (max-width: 980px) {
  .pdf-case-grid {
    grid-template-columns: 1fr;
  }

  .drive-body,
  .pipeline-body {
    min-height: auto;
  }

  .pipeline-body {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
  }

  .pipeline-step + .pipeline-step {
    margin-top: 0;
  }

  .pipeline-step + .pipeline-step::before {
    content: "→";
    top: 50%;
    left: -8px;
    transform: translate(-50%, -50%);
  }
}

@media (max-width: 760px) {
  .pdf-case {
    margin-top: 18px;
    padding: 26px 16px;
    border-radius: 18px;
  }

  .pipeline-body {
    grid-template-columns: 1fr;
  }

  .pipeline-step + .pipeline-step {
    margin-top: 17px;
  }

  .pipeline-step + .pipeline-step::before {
    content: "↓";
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
  }

  .pdf-case-controls {
    grid-template-columns: 1fr;
  }

  .pdf-run-button {
    width: 100%;
  }

  .pdf-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .pdf-result-table th:nth-child(1),
  .pdf-result-table td:nth-child(1),
  .pdf-result-table th:nth-child(6),
  .pdf-result-table td:nth-child(6) {
    display: none;
  }
}
