/* Shared helper styles for the static pages. See page-enhance.js. */

/* Wide screens: a table too wide for its column fits instead of being cut. */
table.pe-tight { min-width: 0 !important; width: 100% !important; font-size: 13.5px !important; }
table.pe-tight th, table.pe-tight td { padding: 9px 10px !important; }

/* Phones: every data table becomes stacked cards. */
@media (max-width: 720px) {
  .pe-stack-wrap { overflow: visible !important; border: 0 !important; background: none !important; box-shadow: none !important; }
  table.pe-stack, table.pe-stack tbody, table.pe-stack tr, table.pe-stack td, table.pe-stack th { display: block; width: auto !important; }
  table.pe-stack { min-width: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; }
  table.pe-stack thead, table.pe-stack tr.pe-head { display: none; }
  table.pe-stack tr {
    background: #fffefe; border: 1px solid #e6e0f2; border-radius: 12px;
    margin: 0 0 10px; padding: 4px 14px;
  }
  table.pe-stack td, table.pe-stack th {
    display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
    border: 0 !important; border-bottom: 1px dashed #e6e0f2 !important;
    padding: 9px 0 !important; text-align: right; background: none !important;
  }
  table.pe-stack td, table.pe-stack th, table.pe-stack .pe-val { white-space: normal !important; }
  table.pe-stack .pe-val { min-width: 0; overflow-wrap: anywhere; }
  /* Long values: label on its own line, value below at full width. */
  table.pe-stack.pe-long td, table.pe-stack.pe-long th { display: block; text-align: left; }
  table.pe-stack.pe-long td::before, table.pe-stack.pe-long th::before {
    display: block; margin-bottom: 3px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
  }
  table.pe-stack td:last-child, table.pe-stack th:last-child { border-bottom: 0 !important; }
  table.pe-stack td::before, table.pe-stack th::before {
    content: attr(data-label); flex: 0 0 44%; text-align: left;
    font-weight: 500; color: #6b5f87;
  }
  /* First cell of each row is the card's title. */
  table.pe-stack tr > :first-child {
    display: block; text-align: left; font-weight: 600; font-size: 16px; color: #0c0a2b;
    padding: 10px 0 8px !important;
  }
  table.pe-stack tr > :first-child::before { content: none; }
}

/* Copy button on code blocks. */
pre.pe-has-copy { position: relative; padding-right: 76px !important; }
.pe-copy {
  position: absolute; top: 8px; right: 8px;
  font: 600 12px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  padding: 6px 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(91, 33, 182, 0.18); background: rgba(255, 255, 255, 0.9); color: #5b21b6;
  transition: background .15s, color .15s;
}
.pe-copy:hover { background: #f2ecfd; }
.pe-copy:focus-visible { outline: 2px solid #8b5cf6; outline-offset: 2px; }
.pe-copy.ok { color: #157a42; border-color: rgba(21, 122, 66, 0.3); }

/* A long file path or command inside a sentence may break anywhere, so it can
   never push the page wider than a phone screen. Code blocks keep scrolling. */
:not(pre) > code { overflow-wrap: anywhere; }
