.plans-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.plans-title h2 { margin: 4px 0; }
.plan-count {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f0dfc6;
  color: var(--brown);
  font-weight: 800;
}
.plan-list { margin-top: 12px; }
.plan-list a,
.plan-list button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.plan-list a > span:nth-child(2),
.plan-list button > span:nth-child(2) { min-width: 0; }
.plan-list a b,
.plan-list button b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plan-list a strong,
.plan-list button strong {
  color: var(--brown);
  font-size: 13px;
  white-space: nowrap;
}
.plan-list a small,
.plan-list button small { display: block; color: var(--muted); margin-top: 3px; }
.file-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 11px;
  background: var(--brown);
  color: white;
  font-size: 11px;
  font-weight: 900;
}
.pdf-viewer {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
  background: #f8f3eb;
}
.viewer-shell { height: 100dvh; overflow: hidden; }
.viewer-shell > header { display: none; }
.viewer-shell > .content {
  width: 100%;
  max-width: none;
  height: 100dvh;
  padding: 0;
}
.pdf-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: #5a301f;
  color: white;
}
.pdf-toolbar button,
.pdf-toolbar a {
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 8px;
  padding: 9px 11px;
  background: transparent;
  color: white;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.pdf-toolbar div { min-width: 0; }
.pdf-toolbar small,
.pdf-toolbar b { display: block; }
.pdf-toolbar small { color: #d9ad5b; font-size: 10px; letter-spacing: 1px; }
.pdf-toolbar b { overflow: hidden; margin-top: 2px; text-overflow: ellipsis; white-space: nowrap; }
.pdf-controls {
  display: grid;
  grid-template-columns: auto auto auto 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #e5d9cb;
  background: white;
}
.pdf-controls button {
  min-width: 38px;
  min-height: 38px;
  border: 1px solid #e5d9cb;
  border-radius: 8px;
  background: white;
  color: #5a301f;
  font-size: 18px;
  font-weight: 800;
}
.pdf-controls button:disabled { opacity: .35; }
.pdf-controls b { min-width: 90px; text-align: center; font-size: 13px; }
.pdf-stage {
  position: relative;
  overflow: auto;
  min-height: 0;
  padding: 14px;
  background: #e8dccd;
  -webkit-overflow-scrolling: touch;
}
.pdf-stage img {
  display: none;
  width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 3px;
  background: white;
  box-shadow: 0 5px 20px rgba(90,48,31,.22);
}
.pdf-stage img.ready { display: block; }
.pdf-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 24px;
  color: #5a301f;
  font-weight: 700;
  text-align: center;
}
.pdf-loading[hidden] { display: none; }
.pdf-loading a { color: #5a301f; }
@media (max-width: 650px) {
  .plan-list a,
  .plan-list button { grid-template-columns: auto 1fr; }
  .plan-list a strong,
  .plan-list button strong { grid-column: 2; }
  .pdf-toolbar { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 8px; }
  .pdf-toolbar button,
  .pdf-toolbar a { padding: 8px; font-size: 12px; }
  .pdf-toolbar button { font-size: 0; }
  .pdf-toolbar button::before { content: "← Retour"; font-size: 12px; }
  .pdf-toolbar small { display: none; }
  .pdf-controls { grid-template-columns: auto auto auto 1fr auto auto; padding: 6px 8px; }
  .pdf-controls button { min-width: 34px; min-height: 34px; }
  .pdf-stage { padding: 8px; }
}
