/* Shared layout and typography; colors follow the selected theme. */
.shell {
  width: min(1040px, calc(100% - 48px));
  padding-top: 40px;
}
.hero { padding-bottom: 28px; }
.hero h1 {
  font-size: clamp(32px, 4.4vw, 46px);
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -.035em;
}
.hero-copy { line-height: 1.8; }
.mode-switch {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  gap: 12px;
  padding: 0;
  margin-bottom: 26px;
  border: 0;
  background: transparent;
  border-radius: 0;
}
.mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-width: 0;
  min-height: 72px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(20, 40, 75, .025);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.mode-btn svg { width: 23px; height: 23px; flex: none; }
.mode-btn:hover { color: var(--accent); background: var(--panel2); border-color: var(--accent); }
.mode-btn.active, .mode-btn[aria-pressed="true"], .mode-btn.active:hover {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
  box-shadow: 0 5px 14px rgba(37, 99, 235, .17);
}
.category-tools {
  padding: 0;
  margin-bottom: 24px;
  border: 0;
  background: transparent;
  border-radius: 0;
}
.category-caption { margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.category-caption strong { font-size: 20px; font-weight: 750; line-height: 1.4; }
.category-caption span { font-size: 13px; }
.tool-tabs { gap: 10px; }
.tool-tabs button {
  min-height: 44px;
  padding: 11px 18px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 550;
  line-height: 1.4;
}
.tool-tabs button:hover { border-color: var(--accent); color: var(--accent); }
.tool-tabs button.active {
  color: var(--accent);
  background: var(--panel2);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  font-weight: 700;
}
.panel { padding: 28px; border-radius: 20px; }
.panel-heading { gap: 18px; margin-bottom: 24px; }
.panel-heading > div { min-width: 0; }
.panel-heading h2 {
  color: var(--ink);
  font-size: 26px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -.025em;
}
.panel-heading p { margin-top: 8px; font-size: 14px; line-height: 1.65; }
.local-pill { padding: 6px 11px; font-size: 12px; }

/* A real upload card replaces the long, narrow file-selection strip. */
.pdf-upload {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 9px;
  min-height: 154px;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--panel2);
  text-align: center;
  cursor: pointer;
}
.pdf-upload::before {
  content: '';
  display: block;
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4m-4 4 4-4 4 4M4 15v4a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-4'/%3E%3C/svg%3E") center / 25px 25px no-repeat;
  box-shadow: 0 2px 5px rgba(20, 40, 75, .035);
}
.pdf-upload .pdf-upload-title { color: var(--ink); font-size: 17px; font-weight: 700; line-height: 1.5; }
.pdf-upload small { margin: 0; max-width: 580px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.pdf-upload:hover { border-color: var(--accent); background: var(--panel2); }
.pdf-upload:focus-within { outline: 3px solid #93b8ff; outline-offset: 3px; border-color: var(--accent); }
.pdf-upload input {
  display: block;
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  border: 0;
  opacity: 0;
  clip-path: inset(50%);
}
.pdf-upload[aria-disabled="true"], .pdf-upload:has(input:disabled) { opacity: .65; cursor: wait; }
.merge-pdf-heading { margin-top: 20px; margin-bottom: 0; }
.merge-pdf-heading p { margin: 0; font-size: 13px; }
#pdfMergeView .empty-state { padding: 34px 20px; }
#pdfMergeView .empty-state p { font-size: 15px; }
#pdfMergeView .empty-state small { font-size: 12px; }
.merge-pdf-note small { font-size: 12px; line-height: 1.7; }
#mergePdfExport, #pdfExport {
  width: fit-content;
  min-width: 230px;
  max-width: 100%;
  margin-left: auto;
  justify-content: center;
  gap: 24px;
  padding: 14px 23px;
  border-radius: 12px;
  font-size: 15px;
}
@media (max-width: 780px) {
  .shell { width: calc(100% - 28px); padding-top: 28px; }
  .hero { padding-bottom: 24px; }
  .mode-switch { gap: 9px; }
  .mode-btn { font-size: 16px; padding: 14px 10px; gap: 8px; }
  .panel { padding: 22px; }
  .panel-heading h2 { font-size: 23px; }
}
@media (max-width: 650px) {
  .mode-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 24px; }
  .mode-btn { min-height: 64px; border-radius: 13px; }
  .mode-btn svg { width: 21px; height: 21px; }
  .category-caption strong { font-size: 18px; }
  .category-caption span { font-size: 12px; }
  .tool-tabs { gap: 8px; }
  .tool-tabs button { font-size: 14px; padding: 10px 14px; }
  .panel { padding: 20px; border-radius: 17px; }
  .panel-heading { gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
  .panel-heading h2 { font-size: 22px; }
  .panel-heading p { font-size: 13px; }
  .local-pill { padding: 5px 8px; font-size: 10px; }
  .pdf-upload { min-height: 152px; padding: 22px 16px; }
  .pdf-upload .pdf-upload-title { font-size: 16px; }
  .pdf-upload small { font-size: 12px; }
  #mergePdfExport, #pdfExport { width: 100%; min-width: 0; }
}
@media (max-width: 380px) {
  .mode-btn { font-size: 15px; }
  .mode-btn svg { width: 19px; height: 19px; }
  .panel-heading h2 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { .mode-btn { transition: none; } }
