/* Printer Terminal alerts, scoped to watched contracts and open tabs. */
.printer-frame .printer-alert-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid var(--ps-rule);
  border-radius: 5px;
  background: transparent;
  color: var(--ps-ink);
  cursor: pointer;
}
.printer-frame .printer-alert-trigger:hover { background: #eceefe; border-color: #c3c9f2; }
.printer-frame .printer-alert-trigger svg { width: 16px; height: 16px; }
.printer-frame .printer-alert-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.printer-frame .printer-alert-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border: 1px solid var(--ps-paper-high);
  border-radius: 8px;
  background: #3c4fed;
  color: white;
  font-size: 9px;
  font-weight: 750;
  line-height: 14px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
:root[data-theme="dark"] .printer-frame .printer-alert-trigger { border-color: #45474d; color: #f1eee7; }
:root[data-theme="dark"] .printer-frame .printer-alert-trigger:hover { background: #292c42; border-color: #7887e7; }
:root[data-theme="dark"] .printer-frame .printer-alert-count { border-color: #1c1d22; }

.printer-alert-dialog {
  position: fixed;
  inset: 62px 12px auto auto;
  width: min(425px,calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 74px);
  margin: 0;
  padding: 0;
  overflow: auto;
  border: 1px solid #45474d;
  border-radius: 7px;
  background: #1c1d21;
  box-shadow: 0 24px 70px #0009;
  color: #f5f0e6;
  color-scheme: dark;
  font: 12px/1.45 Geist,Arial,sans-serif;
}
.printer-alert-dialog::backdrop { background: #08090b70; }
.printer-alert-dialog button,
.printer-alert-dialog input { font: inherit; }
.printer-alert-dialog button:focus-visible,
.printer-alert-dialog input:focus-visible { outline: 2px solid #9ba8ff; outline-offset: 2px; }
.printer-alert-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid #34363a;
}
.printer-alert-context { color: #a7acf2; font-size: 10px; font-weight: 700; letter-spacing: .025em; }
.printer-alert-head h2 { margin: 4px 0 0; color: #f5f0e6; font-size: 19px; line-height: 1.1; font-weight: 700; letter-spacing: -.04em; }
.printer-alert-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #55575d;
  border-radius: 4px;
  background: #292a2f;
  color: #f5f0e6;
  font-size: 19px !important;
  line-height: 1;
  cursor: pointer;
}
.printer-alert-close:hover { background: #36383e; }
.printer-alert-scope { margin: 0; padding: 12px 20px 8px; color: #c4c5ca; font-size: 11px; line-height: 1.5; }
.printer-alert-source { display: flex; align-items: center; gap: 7px; margin: 0; padding: 0 20px 16px; color: #b9c2ff; font-size: 10px; }
.printer-alert-source::before { content: ""; display: block; flex: 0 0 5px; width: 5px; height: 5px; border-radius: 50%; background: #8b9aff; }
.printer-alert-source.delayed { color: #e2b8a3; }
.printer-alert-source.delayed::before { background: #c98166; }
.printer-alert-options { margin: 0 12px; padding: 14px 12px; border: 1px solid #3c3e44; border-radius: 5px; background: #222329; }
.printer-alert-options-title,
.printer-alert-feed-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.printer-alert-options-title { margin: 0 0 11px; }
.printer-alert-options-title strong,
.printer-alert-feed-head strong { color: #f5f0e6; font-size: 12px; font-weight: 680; }
.printer-alert-options-title > span,
.printer-alert-scope-label { color: #a1a2aa; font-size: 10px; }
.printer-alert-check { display: flex; align-items: center; gap: 9px; min-height: 29px; color: #e5e4e2; cursor: pointer; }
.printer-alert-check[hidden] { display: none; }
.printer-alert-check input { flex: 0 0 auto; width: 15px; height: 15px; margin: 0; accent-color: #8a98ff; }
.printer-alert-thresholds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 13px; }
.printer-alert-thresholds label { position: relative; display: flex; flex-direction: column; gap: 6px; color: #c6c6cb; font-size: 10px; line-height: 1.25; }
.printer-alert-thresholds label span { position: absolute; right: 8px; bottom: 10px; color: #898b94; font-size: 9px; pointer-events: none; }
.printer-alert-thresholds input { width: 100%; min-width: 0; height: 32px; padding: 0 34px 0 8px; border: 1px solid #51535d; border-radius: 4px; background: #191a1e; color: #f5f0e6; font-size: 11px; font-variant-numeric: tabular-nums; }
.printer-alert-thresholds input::placeholder { color: #7e8089; }
.printer-alert-browser { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid #3b3d43; }
.printer-alert-browser button { min-height: 26px; padding: 0 8px; border: 1px solid #6972ad; border-radius: 4px; background: #2b3152; color: #e5e9ff; font-size: 10px; font-weight: 650; cursor: pointer; }
.printer-alert-browser button:hover:not(:disabled) { background: #39436e; }
.printer-alert-browser button:disabled { opacity: .55; cursor: default; }
.printer-alert-browser small { color: #9ea0aa; font-size: 9px; }
.printer-alert-feed-head { margin: 19px 20px 10px; }
.printer-alert-feed-head > div { display: flex; align-items: baseline; gap: 7px; }
.printer-alert-feed-head button { padding: 3px 0; border: 0; background: transparent; color: #aeb9ff; font-size: 10px; cursor: pointer; }
.printer-alert-feed-head button:disabled { color: #71727a; cursor: default; }
.printer-alert-feed { max-height: min(250px,32dvh); overflow: auto; margin: 0 12px; border: 1px solid #383a41; border-radius: 5px; background: #17181c; }
.printer-alert-empty { padding: 22px 18px; text-align: center; }
.printer-alert-empty strong { color: #e6e4df; font-size: 12px; font-weight: 650; }
.printer-alert-empty p { max-width: 280px; margin: 5px auto 0; color: #a1a3aa; font-size: 10px; line-height: 1.5; }
.printer-alert-event { display: block; width: 100%; padding: 11px 12px; border: 0; border-bottom: 1px solid #34363c; background: transparent; color: #f4f0e9; text-align: left; cursor: pointer; }
.printer-alert-event:last-child { border-bottom: 0; }
.printer-alert-event:hover { background: #262a36; }
.printer-alert-event.unread { box-shadow: inset 2px 0 #8e9aff; }
.printer-alert-event-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.printer-alert-event-top strong { font-size: 11px; font-weight: 700; }
.printer-alert-event-top time { color: #8f929b; font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.printer-alert-event-symbol { display: block; margin-top: 3px; color: #c4c9ff; font-size: 10px; font-weight: 620; }
.printer-alert-event-symbol span { color: #858891; font-weight: 450; }
.printer-alert-event-detail { display: block; margin-top: 4px; color: #bfc0c6; font-size: 10px; line-height: 1.4; }
.printer-alert-foot { margin: 10px 20px 16px; color: #92949d; font-size: 9px; line-height: 1.5; }
.printer-alert-preview {
  position: fixed;
  z-index: 100;
  right: 15px;
  bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(350px,calc(100vw - 30px));
  padding: 11px 10px;
  border: 1px solid #6675d4;
  border-radius: 5px;
  background: #22253b;
  box-shadow: 0 12px 45px #0009;
  color: #f3f1ef;
  font: 11px/1.35 Geist,Arial,sans-serif;
}
.printer-alert-preview[hidden] { display: none; }
.printer-alert-preview img { flex: 0 0 20px; }
.printer-alert-preview span { flex: 1; min-width: 0; }
.printer-alert-preview strong,
.printer-alert-preview small { display: block; }
.printer-alert-preview strong { font-size: 11px; font-weight: 700; }
.printer-alert-preview small { margin-top: 2px; color: #c0c4df; font-size: 10px; }
.printer-alert-preview button { flex: 0 0 22px; height: 22px; padding: 0; border: 0; background: transparent; color: #f3f1ef; font: 18px/1 Geist,Arial,sans-serif; cursor: pointer; }

@media (max-width: 900px) {
  .printer-alert-dialog { inset: 0; width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .printer-alert-head { padding: 18px 16px 13px; }
  .printer-alert-scope { padding: 12px 16px 8px; }
  .printer-alert-source { padding: 0 16px 16px; }
  .printer-alert-options { margin: 0 10px; }
  .printer-alert-feed { max-height: none; margin: 0 10px; }
  .printer-alert-feed-head { margin: 19px 16px 10px; }
  .printer-alert-foot { margin: 10px 16px 20px; }
}
@media (max-width: 370px) {
  .printer-frame .printer-alert-trigger { flex-basis: 30px; width: 30px; min-width: 30px; }
  .printer-alert-thresholds { grid-template-columns: 1fr; }
}
