/* apwizard.css - the wizards of the Flash AP tab (js/apwizard.js) and the Flash tag tab
   (js/tagwizard.js, the tw- rules at the end). Not in style.css, which the AP packs into its
   firmware (ap/main/webui.py) without these tabs. */
.wz { max-width: 1080px; }
.wz-steps { display: flex; align-items: center; list-style: none; padding: 0; margin: 4px 0 22px; gap: 0; }
.wz-steps li { display: flex; align-items: center; gap: var(--space-2); color: var(--muted); font-weight: 600; min-width: 0; }
.wz-steps li:not(:last-child) { flex: 1; }
.wz-steps li:not(:last-child)::after { content: ""; flex: 1; height: 2px; background: var(--line); margin: 0 var(--space-3); min-width: 16px; }
.wz-steps li.done:not(:last-child)::after { background: var(--ok); }
.wz-dot { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); background: var(--panel); font-size: var(--fs-sm); }
.wz-steps .on, .wz-steps .done { color: var(--text); }
.wz-steps .on .wz-dot { border-color: var(--accent); background: var(--accent); color: var(--accent-text); }
.wz-steps .done .wz-dot { border-color: var(--ok); background: var(--ok); color: var(--panel); }
.wz-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wz h2 { font-size: var(--fs-xl); margin: 0 0 var(--space-3); }
.wz-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-3); }
.wz-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: var(--space-3); border-radius: var(--radius); text-align: left; }
.wz-card[aria-pressed="true"] { border: 2px solid var(--accent); padding: 11px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.wz-pic { display: block; width: 100%; height: 120px; border-radius: var(--radius-sm); background: var(--bg); padding: var(--space-1); }
.wz-pic svg { width: 100%; height: 100%; }
.wz-chips { display: flex; gap: var(--space-1); flex-wrap: wrap; }
.wz-chip { font-size: var(--fs-xs); font-weight: 700; border-radius: var(--radius-sm); padding: 1px 6px; background: color-mix(in srgb, var(--muted) 15%, transparent); }
.wz-chip.s3 { background: color-mix(in srgb, var(--chip-s3) 20%, transparent); }
.wz-chip.c6 { background: color-mix(in srgb, var(--chip-c6) 22%, transparent); }
.wz-chip.c5 { background: color-mix(in srgb, var(--chip-c5) 22%, transparent); }
.wz-badge { font-size: var(--fs-xs); font-weight: 600; padding: 1px 7px; border-radius: 999px; color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.wz-badge.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.wz-badge.rec { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.wz-line { font-size: var(--fs-xs); color: var(--muted); line-height: 1.35; }
.wz-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.wz-head h2 { margin-bottom: 0; }
.wz-help { font-size: var(--fs-sm); }
.wz-opts { display: flex; flex-wrap: wrap; gap: 14px 28px; margin: 18px 0 6px; }
.wz-opt { display: inline-flex; align-items: center; gap: 10px; }
.wz-seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.wz-seg button { border: 0; border-radius: 0; border-right: 1px solid var(--line); padding: 7px 13px; }
.wz-seg button:last-child { border-right: 0; }
.wz-seg button[aria-checked="true"] { color: var(--accent); font-weight: 600; background: color-mix(in srgb, var(--accent) 12%, var(--panel)); box-shadow: inset 0 0 0 1px var(--accent); }
.wz-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 18px; }
.wz-part { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) 0; border-top: 1px solid var(--line); }
.wz-part:first-child { border-top: 0; }
.wz-part.dim { opacity: 0.5; }
.wz-grow { flex: 1; min-width: 0; }
.wz-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 700; border: 2px solid var(--line); color: var(--muted); }
.wz-n.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.wz-n.done { background: var(--ok); border-color: var(--ok); color: var(--panel); }
.wz-row { display: flex; gap: 22px; align-items: center; margin-top: var(--space-2); }
.wz-board { width: 70px; height: 100px; flex: none; }
.wz-prog { display: flex; justify-content: space-between; }
.wz-hint { background: color-mix(in srgb, var(--accent) 9%, var(--panel)); border-radius: var(--radius); padding: 10px 12px; margin: var(--space-3) 0 0; }
.wz-wiring { display: block; max-width: 520px; width: 100%; margin-top: var(--space-2); border-radius: var(--radius-sm); border: 1px solid var(--line); }
.wz-split { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: var(--space-4); margin-top: var(--space-2); }
.wz-aside { background: var(--bg); border-radius: var(--radius); padding: var(--space-3); }
.wz-aside p { margin: var(--space-1) 0; }
.wz-form { max-width: 520px; }
.wz-token { display: flex; gap: var(--space-1); min-width: 0; }
.wz-token input { flex: 1; min-width: 0; }
.wz-indent { margin: 0 0 0 104px; }
.wz-log { background: var(--bg); border-radius: var(--radius-sm); padding: var(--space-2); font-size: var(--fs-xs); white-space: pre-wrap; margin: var(--space-2) 0 0; }
.wz-foot { display: flex; align-items: center; gap: 10px; margin: 20px 0 8px; }
.wz-done { text-align: center; padding: 26px 18px; }
.wz-big { font-size: var(--fs-2xl); }
.wz-addr { font-size: var(--fs-md); }
.wz-center { justify-content: center; }
.wz .ok { color: var(--ok); }
.wz .error { color: var(--error); }
button.ghost, .button.ghost { border-color: transparent; background: transparent; }
a.button { color: inherit; text-decoration: none; display: inline-block; }
a.button.primary { color: var(--accent-text); }
/* the Flash tag tab */
.wz-photo { display: flex; align-items: center; justify-content: center; }
.wz-photo img, .wz-photo canvas { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.wz-photo canvas { background: var(--paper); border: 1px solid var(--line); }
.wz-flasher { flex: none; width: 250px; }
.wz-flasher svg { width: 100%; height: auto; display: block; }
.tw-stages { display: flex; flex-wrap: wrap; gap: 6px 22px; list-style: none; padding: 0; margin: 10px 0 12px; color: var(--muted); font-weight: 600; }
.tw-stages li { display: flex; align-items: center; gap: 7px; }
.tw-stages li.on, .tw-stages li.done { color: var(--text); }
.tw-loop { display: inline-flex; align-items: center; gap: 6px; margin-left: var(--space-2); }
.tw-wait { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: var(--space-3) 0; }
.tw-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: tw-spin 0.9s linear infinite; }
@keyframes tw-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tw-spin { animation: none; } }
.tw-mac { margin-top: 10px; }
.tw-mac input { flex: 1; min-width: 0; max-width: 320px; }
.tw-results { margin-top: 14px; width: 100%; border-collapse: collapse; }
.tw-results th, .tw-results td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tw-results th { color: var(--muted); font-weight: 600; }
.tw-results td:first-child { width: 1.5em; }
.tw-logbox { margin-top: var(--space-3); }
.tw-logbox summary { cursor: pointer; color: var(--muted); }
.tw-logbox .wz-log { max-height: 240px; overflow: auto; }
.wz-log .good { color: var(--ok); }
.wz-log .err { color: var(--error); }
.tw-backups { margin-top: 28px; }
.tw-backups .wz-panel { padding: 14px 18px; }
.tw-backups h2 { font-size: var(--fs-lg); margin: 0 0 var(--space-1); display: flex; align-items: center; gap: var(--space-2); }
.tw-bhead { display: flex; gap: var(--space-4); align-items: flex-start; flex-wrap: wrap; }
.tw-bhead .muted { margin: 0; max-width: 640px; }
.tw-backups .tw-results { margin-top: 10px; }
.tw-backups .tw-results td:first-child { width: auto; }
.tw-backups td { vertical-align: middle; }
.tw-backups td a { margin-right: var(--space-2); }
#backup-persist:empty { display: none; }
.tw-bhead > .wz-grow { flex: 1 1 320px; }
.wz-badge:empty { display: none; }
@media (max-width: 700px) {
  .wz-label { display: none; }
  .wz-steps .on .wz-label { display: inline; overflow: visible; }
  .wz-steps li.on { flex: 1 0 auto; }
  .wz-split { grid-template-columns: 1fr; }
  .wz-indent { margin-left: 0; }
  .wz-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wz-row { flex-wrap: wrap; }
  .wz-flasher { width: 100%; max-width: 250px; }
  .tw-loop { margin-left: 0; }
}
.wz a.button { padding: 5px 10px; }
.wz a.button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.wz-part .wz-form { margin-top: var(--space-2); }
.wz-erase { margin: var(--space-2) 0 0; }
