/* The "See example formats" disclosure and its shape cards (BF-218/BF-219).

   The cards wear the Accession bones the Card Tournament picked on
   2026-08-16: warm paper, one hairline edge, square corners, no shadow, and
   one forest stripe when chosen. Every color here is a shared token from
   action-semantics.css or base.html, so night mode arrives with the rest of
   the app instead of needing its own patch. */

.import-shapes,
.import-depth {
  margin-top: .75rem;
}

.import-shapes > summary,
.import-depth > summary {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .25rem .15rem;
  color: var(--tr-brand-ink, #2f5d3f);
  font-size: .875rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.import-depth > summary { font-size: .84rem; }

.import-shapes > summary::-webkit-details-marker,
.import-depth > summary::-webkit-details-marker {
  display: none;
}

.import-shapes > summary:focus-visible,
.import-depth > summary:focus-visible {
  outline: 3px solid var(--bs-focus-ring-color, #0d6efd);
  outline-offset: 2px;
  border-radius: .25rem;
}

.import-shapes-chevron {
  width: .5rem;
  height: .5rem;
  margin-top: -.15rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .12s;
}

.import-shapes[open] > summary .import-shapes-chevron,
.import-depth[open] > summary .import-shapes-chevron {
  transform: rotate(45deg);
}

.import-shapes-help {
  margin: .5rem 0 .75rem;
  color: var(--tr-card-subline, #575350);
  font-size: .8rem;
}

.import-shapes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.75rem, 1fr));
  gap: .625rem;
}

.import-shape {
  display: flex;
  flex-direction: column;
  gap: .375rem;
  min-height: 7rem;
  padding: .625rem .75rem .7rem;
  border: 1px solid var(--tr-card-edge, #e8e5e0);
  border-radius: 0;
  background: var(--tr-card-paper, #faf8f6);
  color: var(--tr-card-title, #1a1a1a);
  font: inherit;
  text-align: left;
  transition: background-color .12s, border-color .12s;
}

button.import-shape { cursor: pointer; }

button.import-shape:hover {
  background: var(--tr-card-paper-hover, #fcfbf9);
  border-color: var(--tr-card-edge-hover, #dcd8d0);
}

button.import-shape:focus-visible {
  outline: 3px solid var(--bs-focus-ring-color, #0d6efd);
  outline-offset: 2px;
}

.import-shape[aria-pressed="true"] {
  border-color: var(--tr-brand, #2f5d3f);
  box-shadow: inset 3px 0 0 var(--tr-brand, #2f5d3f);
  background: var(--tr-brand-surface, #eef4f0);
}

.import-shape-name {
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.3;
}

.import-shape pre {
  margin: .125rem 0 0;
  color: var(--tr-card-subline, #575350);
  font-family: var(--bs-font-monospace, ui-monospace, Consolas, monospace);
  font-size: .69rem;
  line-height: 1.35;
  white-space: pre;
  overflow: hidden;
}

/* A spreadsheet header row is one long line, so those cards wrap instead of
   clipping the last column names out of sight. */
.import-shapes-grid.is-header-rows { grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.import-shapes-grid.is-header-rows .import-shape pre { white-space: pre-wrap; word-break: break-word; }

.import-shape[aria-pressed="true"] pre {
  color: var(--tr-card-title, #1a1a1a);
  opacity: .85;
}

.import-shape-after {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin: .75rem 0 0;
  color: var(--tr-card-subline, #575350);
  font-size: .8rem;
}

.import-shape-after b { color: var(--tr-card-title, #1a1a1a); font-weight: 600; }

.import-shape-undo {
  padding: 0;
  border: 0;
  background: none;
  color: var(--tr-brand-ink, #2f5d3f);
  font: inherit;
  font-size: .8rem;
  text-decoration: underline;
  cursor: pointer;
}

.import-shape-undo:focus-visible {
  outline: 3px solid var(--bs-focus-ring-color, #0d6efd);
  outline-offset: 2px;
}

.import-depth-body {
  max-width: 72ch;
  margin-top: .5rem;
  padding: .7rem .85rem;
  border: 1px solid var(--tr-brand-border, #cfe0d5);
  background: var(--tr-brand-surface, #eef4f0);
  color: var(--tr-card-title, #1a1a1a);
  font-size: .82rem;
}

.import-depth-body p { margin: 0 0 .5rem; }
.import-depth-body p:last-child { margin: 0; }

.import-depth-code {
  padding: 0 .25rem;
  border: 1px solid var(--tr-card-edge, #e8e5e0);
  background: var(--bs-body-bg, #fff);
  font-family: var(--bs-font-monospace, ui-monospace, Consolas, monospace);
  font-size: .78rem;
}

@media (prefers-reduced-motion: reduce) {
  .import-shape,
  .import-shapes-chevron { transition: none; }
}

@media (forced-colors: active) {
  .import-shape { border: 1px solid ButtonBorder; }
  .import-shape[aria-pressed="true"] { outline: 2px solid Highlight; }
}
