/* Wave-1 developer tools (webtools_push.py): widget styles
   webtools.css doesn't have. Loaded on these pages only, after webtools.css and before
   tools-premium.css, so rules that must beat tools-premium.css use a .tp-stage / .tp prefix.
   The table rules are copied from webtools-more.css (not loaded on these pages). */
/* .ti--push and --c-push-1/2 live in tools-premium.css with the other category colours */
:root { --warn-text: #9a5b00; }
@media (prefers-color-scheme: dark) { :root { --warn-text: #ffb340; } }

/* never let a grid/flex display rule override [hidden] inside the tools (B4) */
.tool [hidden], .tool[hidden] { display: none !important; }
/* keep long code and identifiers inside the stage on phones */
.tp-stage .tool { grid-template-columns: minmax(0, 1fr); }
.tp-stage .tool > *, .tp-stage .tool .wt-grid > *, .tp-stage .tool label { min-width: 0; }
.tp-stage .tool pre { max-width: 100%; overflow-x: auto; }
.tp-stage .wt-report li, .mp-table td, .mp-table th { overflow-wrap: anywhere; }

/* code blocks: keyboard focus ring and an empty state */
.tp-stage .wt-code:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tp-stage .wt-code:empty::before { content: attr(data-empty); color: var(--text-3); font-family: var(--font, inherit); white-space: normal; }
@media (max-width: 734px) { .tp-stage .wt-code.wt-wrap { white-space: pre-wrap; overflow-wrap: anywhere; } }
.tp-stage .wt-h { font-size: 1.05rem; margin: 0.5rem 0 0; }

/* buttons: disabled copy buttons, quiet links, primary on its own row on phones */
.tp-stage .tool .btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.wt-quiet { all: unset; display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.25rem; cursor: pointer; color: var(--accent); font-weight: 500; font-size: 0.9rem; }
.wt-quiet:hover { text-decoration: underline; }
.wt-quiet:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wt-quiet.is-danger { color: var(--bad); }
.wt-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.25rem; font-size: 0.85rem; color: var(--text-3); }
@media (max-width: 734px) { .tp-stage .wt-btns .btn-primary { flex: 1 1 100%; } }
.tp-stage .tool textarea[readonly] { background: var(--surface-2, var(--bg-2, var(--bg))); border-style: dashed; resize: vertical; }
/* iOS Safari zooms into inputs under 16px */
@media (max-width: 734px) { .tp-stage .tool textarea { font-size: 16px; } }

/* field-level errors */
.tool [aria-invalid="true"] { border-color: var(--bad) !important; }
.wt-field-err { margin: 0; font-size: 0.85rem; font-weight: 600; color: var(--bad); }
.wt-field { display: grid; gap: 0.35rem; align-content: start; }

/* warning text: --star (#f5a623) is 2:1 on white, so text uses --warn-text (B5) */
.tp-stage .wt-warn strong, .tp-stage .wt-age.wt-warn, .tp-stage .wt-count.is-near, .tp-stage .mp-table td.is-warn,
.tp-stage .tk-row.wt-warn .tk-head strong, .tp-stage .wt-report li.wt-warn { color: var(--warn-text); }
.tp-stage .wt-report li.wt-warn { color: var(--text); }
.tp-stage .wt-report li.wt-warn > strong:first-child { color: var(--warn-text); }

.wt-privacy { margin: 0 0 0.75rem; padding: 0.6rem 0.85rem; border-left: 3px solid var(--ok); background: var(--bg); border-radius: var(--radius-sm); font-size: 0.92rem; }
.wt-drop { border: 2px dashed var(--border); border-radius: var(--radius-sm); padding: 1rem; text-align: center; }
.wt-drop.is-drop, .wt-drop.is-over, textarea.is-drop { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.wt-drop label { display: inline-grid; justify-items: center; margin-top: 0.5rem; }
.wt-file { display: grid; gap: 0.35rem; }
.wt-age { font-weight: 600; min-height: 1.4em; margin: 0.25rem 0; }
.wt-age.wt-ok { color: var(--ok); } .wt-age.wt-err { color: var(--bad); }
.wt-checks { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.wt-example { margin: 0; font-size: 0.85rem; color: var(--text-3); display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.5rem; }

/* JWT: key chip shown instead of the PEM once the key is imported */
.wt-keychip { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; padding: 0.5rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); font-size: 0.92rem; }
.wt-keychip span { flex: 1 1 14rem; }

/* tables (from webtools-more.css; B3) */
.wt-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.wt-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.wt-table th, .wt-table td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.wt-table th { text-transform: none; letter-spacing: normal; font-size: inherit; }
.wt-table thead th { font-weight: 600; color: var(--text-2); background: var(--surface, var(--bg)); }
.wt-table tbody th { font-weight: 600; color: var(--text); }
.wt-table caption { text-align: left; caption-side: top; padding-bottom: 0.4rem; }
/* phones: stack the 4-column tables (S15) */
@media (max-width: 600px) {
  .wt-table.wt-stack, .wt-table.wt-stack tbody, .wt-table.wt-stack caption { display: block; width: 100%; }
  .wt-table.wt-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .wt-table.wt-stack tr { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .wt-table.wt-stack td, .wt-table.wt-stack th { border: 0; padding: 0; }
  .wt-table.wt-stack td[data-label] { grid-column: 1 / -1; }
  .wt-table.wt-stack td[data-label]::before { content: attr(data-label) ": "; color: var(--text-3); font-weight: 600; }
  .wt-table.wt-stack td.wt-lead { grid-column: auto; }
  .wt-table.wt-stack td.wt-lead::before { content: none; }
}

.wt-pick { all: unset; display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; text-align: left; cursor: pointer;
  font: 600 0.88rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--accent); text-decoration: underline dotted; text-underline-offset: 3px; overflow-wrap: anywhere; }
.wt-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wt-statuses { columns: 2 16rem; font-size: 0.9rem; }
.wt-result h2 { margin-top: 0; font-size: 1.15rem; }
.wt-result h3 { margin: 0.75rem 0 0.25rem; font-size: 0.95rem; }

/* token checker / screenshot checker result rows */
.tk-list, .ss-list { list-style: none; margin: 0.5rem 0; padding: 0; display: grid; gap: 0.5rem; }
.tk-row, .ss-row { padding: 0.6rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.tk-row.wt-ok, .ss-row.wt-note { border-left: 4px solid var(--ok); }
.tk-row.wt-warn { border-left: 4px solid var(--star); }
.tk-row.wt-err, .ss-row.wt-err { border-left: 4px solid var(--bad); }
.tk-head { margin: 0 0 0.25rem; }
.tk-val { display: block; overflow-wrap: anywhere; font-size: 0.8rem; }
.tk-row ul, .ss-row ul { margin: 0.35rem 0 0; padding-left: 1.1rem; font-size: 0.9rem; }

/* character counter */
.wt-tabs { display: flex; gap: 0.25rem; margin-bottom: 0.75rem; }
.wt-tabs [role="tab"] { min-height: 44px; padding: 0 1rem; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.wt-tabs [aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.cc-field { margin-bottom: 0.75rem; }
.cc-field label { display: block; }
.wt-count { display: block; text-align: right; font-size: 0.85rem; font-variant-numeric: tabular-nums; color: var(--text-3, inherit); }
.wt-count.is-near { font-weight: 600; }
.wt-count.is-over { color: var(--bad); font-weight: 700; }

/* mobileprovision viewer */
.mp-table th { width: 34%; }
.mp-table td { font-variant-numeric: tabular-nums; }
.mp-table td.is-bad { color: var(--bad); font-weight: 600; }
.mp-table td.is-warn { font-weight: 600; }
.mp-devices { max-height: 16rem; overflow: auto; margin: 0.5rem 0; padding-left: 1.2rem; font: 0.8rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.tool details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }

/* app nudge: on phones tools-premium.css turns it into a fixed toast that can cover the stage's
   buttons (B2). On these pages it stays inline in the stage footer, below every output. */
@media (max-width: 734px) {
  .tp-stage .tp-foot .tp-nudge { position: static; left: auto; right: auto; bottom: auto; z-index: auto; box-shadow: none; }
  .tp-stage .tp-foot.is-nudge .tp-trust { visibility: hidden; }
}

/* /tools/push/ hub: every card names the same app; drop the repeated line (nice-to-have 1) */
.tix[data-hub="push"] .cards .meta .app { display: none; }
.tp-hero h1 { text-wrap: balance; }
/* JWT H1: keep "(.p8 provider token)" on one line; on the narrowest phones shrink it a little so it still fits */
.wt-nw { white-space: nowrap; }
@media (max-width: 380px) { .tp-hero h1 .wt-nw { font-size: 0.82em; } }
