/* Autobyte — parasitic draw: sleep timer, stages, 3-stage popup, swatch */

.calc__grid--single { grid-template-columns: minmax(0, 560px); justify-content: center; }

/* fuse colour swatch */
.pd-swatch {
  display: inline-block; width: 13px; height: 13px; border-radius: 3px;
  border: 1px solid var(--border); margin-right: 7px; vertical-align: -2px;
}

/* sleep timer */
.pd-timer {
  font-family: "Consolas", ui-monospace, monospace;
  font-size: clamp(40px, 9vw, 60px); font-weight: 800; text-align: center;
  color: var(--primary); letter-spacing: 1px; margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
}
.pd-status {
  text-align: center; font-weight: 700; font-size: 14px;
  padding: 8px 12px; border-radius: 10px; margin: 0 auto 6px; max-width: 380px;
}
.pd-status--idle { background: var(--surface-2); color: var(--muted); }
.pd-status--warn { background: rgba(209,73,91,.12); color: #d1495b; }
.pd-status--mid  { background: rgba(224,138,30,.14); color: var(--accent); }
.pd-status--ok   { background: rgba(46,158,91,.14); color: var(--ok); }

.pd-timer-btns { display: flex; gap: 10px; justify-content: center; margin: 6px 0 16px; }
.pd-btn-ghost {
  background: transparent; color: var(--primary); border: 1px solid var(--primary);
}
.pd-btn-ghost:hover { background: rgba(14,124,123,.10); }

.pd-stages { display: grid; gap: 10px; }
.pd-stage {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.pd-stage.on { border-color: var(--primary); background: rgba(14,124,123,.06);
  box-shadow: 0 0 0 3px rgba(14,124,123,.10); }
.pd-stage__n {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-2); color: var(--muted);
  display: grid; place-items: center; font-weight: 800; font-size: 13px;
}
.pd-stage.on .pd-stage__n { background: var(--primary); color: #fff; }
.pd-stage__t { font-weight: 700; font-size: 13.5px; }
.pd-stage__d { color: var(--muted); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }

/* 3-stage information popup */
.pd-pop {
  position: fixed; inset: 0; z-index: 70; display: flex;
  align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto;
  background: rgba(8,14,18,.6); backdrop-filter: blur(2px); animation: fade .2s ease both;
}
.pd-pop__panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); padding: 24px 26px; max-width: 540px; width: 100%;
  animation: pop .26s cubic-bezier(.2,.8,.2,1) both;
}
.pd-pop__title { margin: 0 0 8px; font-size: 19px; font-weight: 800; }
.pd-pop__intro { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.pd-pop__stages { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 10px; }
.pd-pop__stages li { font-size: 13.5px; line-height: 1.5; }
.pd-pop__note { font-size: 12.5px; color: var(--muted); margin: 0 0 18px;
  border-left: 3px solid var(--accent); padding-left: 10px; }
.pd-pop__btns { display: flex; gap: 10px; justify-content: flex-end; }

/* measurements log */
.pd-veh { grid-template-columns: 1fr 1fr; }
.pd-add-row { margin-top: 12px; }
.pd-add-row--end { display: flex; justify-content: flex-end; }
.pd-cur-norm { color: var(--ok) !important; font-weight: 700; }
.pd-cur-elev { color: var(--accent) !important; font-weight: 700; }
.pd-cur-high { color: #d1495b !important; font-weight: 700; }
.pd-cur-bad  { color: var(--muted) !important; }

.pd-logwrap { overflow-x: auto; margin-top: 4px; }
.pd-log { width: 100%; border-collapse: collapse; font-size: 13px; }
.pd-log th {
  text-align: left; padding: 8px 10px; color: var(--muted);
  font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.pd-log td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.pd-log tr:last-child td { border-bottom: 0; }
.pd-empty { color: var(--muted); font-style: italic; text-align: center; padding: 20px !important; }
.pd-del {
  border: 0; background: var(--surface-2); color: var(--muted);
  width: 24px; height: 24px; border-radius: 6px; cursor: pointer; font-size: 15px; line-height: 1;
}
.pd-del:hover { background: #d1495b; color: #fff; }

.pd-badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pd-badge--norm { background: rgba(46,158,91,.14); color: var(--ok); }
.pd-badge--elev { background: rgba(224,138,30,.16); color: var(--accent); }
.pd-badge--high { background: rgba(209,73,91,.14); color: #d1495b; }

.pd-summary {
  margin-top: 14px; padding: 12px 14px; border-radius: 10px; font-size: 14px;
  background: var(--surface-2); color: var(--slate); text-align: center;
}
.pd-summary--norm { background: rgba(46,158,91,.12); color: var(--ok); }
.pd-summary--elev { background: rgba(224,138,30,.14); color: var(--accent); }
.pd-summary--high { background: rgba(209,73,91,.12); color: #d1495b; }

@media (max-width: 540px) { .pd-veh { grid-template-columns: 1fr; } }

/* pre-test checklist */
.pd-check { display: grid; gap: 8px; margin-top: 4px; }
.pd-chk { display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface);
  font-size: 14px; transition: border-color .15s, background .15s; }
.pd-chk:hover { border-color: var(--primary); }
.pd-chk input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.pd-chk input:checked + span { color: var(--muted); text-decoration: line-through; }
.pd-ready { margin-top: 12px; text-align: center; font-weight: 700; font-size: 14px;
  padding: 10px; border-radius: 10px; }
.pd-ready--no { background: var(--surface-2); color: var(--muted); }
.pd-ready--yes { background: rgba(46,158,91,.14); color: var(--ok); }

/* fuse graphic */
.pd-fuse-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 8px 0 2px; }
.pd-fuse { width: 96px; height: auto; filter: drop-shadow(0 2px 4px rgba(0,0,0,.18)); }
.pd-fuse-cap { font-size: 12px; color: var(--muted); font-weight: 600; }

/* exact-text info panels (colours match the desktop app dialogs) */
.pd-pop__panel--wide { max-width: 680px; }
.pd-panel { border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; border: 1px solid;
  color: #20303a; font-size: 13px; line-height: 1.5; }
.pd-panel p { margin: 6px 0; }
.pd-panel--g  { background: #e9f7ee; border-color: #a9dcb9; }
.pd-panel--y  { background: #fff6e0; border-color: #f0d28a; }
.pd-panel--b  { background: #e7f1fb; border-color: #b3d2ef; }
.pd-panel--lb { background: #eaf4fb; border-color: #bcdcf0; }
.pd-panel__t { font-weight: 800; font-size: 13.5px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.pd-panel__t::before { content: ""; width: 11px; height: 11px; border-radius: 50%; flex: none; }
.pd-panel--g  .pd-panel__t::before { background: #2e9e5b; }
.pd-panel--y  .pd-panel__t::before { background: #e0a01e; }
.pd-panel--b  .pd-panel__t::before { background: #2b7fd1; }
.pd-panel--lb .pd-panel__t::before { background: #2b9fd1; }
.pd-bul { margin: 6px 0; padding-left: 20px; }
.pd-bul li { margin: 3px 0; }
.pd-sub { font-weight: 700; margin-top: 10px; }
.pd-warn { color: #b23a3a; font-weight: 700; margin-top: 10px; }
.pd-ok { color: #1f8a4c; font-weight: 700; margin-top: 10px; }
.pd-norm { font-weight: 400; }
