/* /check and /status only (lib/web/pages/service-tools.mjs); loaded after app.css. */
.service-tool { --st-chip: color-mix(in srgb, var(--line) 55%, var(--surface)); --st-err: #c9342f; background: var(--surface-2); color: var(--ink); overflow-wrap: anywhere; font-synthesis: none }
.service-tool h1,.service-tool h2,.service-tool p,.service-tool ol,.service-tool ul { margin: 0 }
.service-tool h1 { font-family: inherit; color: var(--ink) }
.service-tool a { color: var(--action); text-decoration: none }
.service-tool a:hover { text-decoration: underline; text-underline-offset: 3px }
.service-tool svg { flex: none }
.check-tool { padding: clamp(65px,13vh,141px) 16px 100px; min-height: 85vh }
.check-shell { max-width: 560px; margin: auto }
.check-tool .check-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--muted) }
.check-tool header { text-align: center; margin: 24px 0 28px }
.check-tool h1 { font-size: clamp(34px,3.75vw,54px); font-weight: 700; line-height: 1.12; letter-spacing: -.03em }
.check-tool header p { max-width: 432px; margin: 12px auto 0; color: var(--muted); font-size: .95rem; line-height: 1.65 }
.check-card { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 2px 4px #17191d0d,0 12px 28px -12px #17191d24; overflow: hidden }
.check-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 18px; font-size: 13px; line-height: 20px; border-bottom: 1px solid var(--line); color: var(--muted) }
.check-bar b { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-2) }
.check-bar [data-check-state] { display: inline-flex; align-items: center; gap: 6px }
.check-bar [data-state=parsed] { color: var(--ok); font-weight: 600 }
.check-bar [data-state=invalid] { color: var(--warn); font-weight: 600 }
.check-steps { padding: 36px 20px 20px; text-align: center; font-size: 13px; color: var(--ink-2) }
.check-steps[hidden],.check-result[hidden],.check-error[hidden],.check-busy[hidden],[data-check-form][hidden] { display: none }
.check-steps h2 { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; line-height: 24px; color: var(--ink) }
.check-steps kbd { padding: 1px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--st-chip); color: var(--ink-2); font-family: inherit; font-size: 11px; font-weight: 600; line-height: 18px }
.check-steps ol { padding: 0; list-style: none; width: fit-content; max-width: 100%; margin: 14px auto 37px; counter-reset: step }
.check-steps li { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 9px; min-height: 25px; margin: 9px 0; counter-increment: step; text-align: start }
.check-steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 18px; height: 18px; background: var(--st-chip); border-radius: 50%; color: var(--muted); font-size: 11px; font-weight: 700 }
.check-url { display: inline-flex; align-items: center; gap: 2px; min-height: 33px; padding: 2px 3px 2px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; max-width: 100% }
.check-url a { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); font: 600 12.5px/20px ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere }
.check-url button { display: inline-grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer }
.check-url button:hover { background: var(--st-chip); color: var(--ink) }
.check-url button[data-copied] { color: var(--ok) }
.check-input { display: block }
.check-input textarea { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; resize: none }
.check-tool.is-manual .check-input textarea,.check-input textarea:focus-visible { position: static; width: 100%; height: auto; opacity: 1; pointer-events: auto; margin: 0 0 18px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink); font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical }
.check-error { margin: -16px 0 16px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb,var(--warn) 9%,var(--surface)); color: var(--warn); text-align: start; line-height: 1.6 }
.check-error[data-tone=hint] { background: var(--surface-2); color: var(--ink-2) }
.check-card .check-help { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--action); color: var(--action-ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 14px -4px color-mix(in srgb,var(--action) 55%,transparent); transition: background-color .15s }
.check-card .check-help:hover { background: var(--action-hover); text-decoration: none }
@media (pointer: coarse) { .check-steps kbd { display: none } .check-tool.is-manual .check-input textarea,.check-input textarea:focus-visible { font-size: 16px } }
.check-tool .check-note { text-align: center; margin-top: 16px; display: grid; gap: 5px; font-size: 12px; line-height: 1.6; color: var(--muted) }
.check-note p:first-child { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--ink-2) }
.status-tool { min-height: 80vh; padding-bottom: 64px }
.status-heading { padding: 13px 20px 48px; border-bottom: 1px solid var(--line); background: var(--surface) }
.status-heading div { max-width: 704px; margin: auto }
.status-heading h1 { font-size: clamp(28px,3.5vw,44px); font-weight: 800; line-height: 1.1; letter-spacing: -.02em }
.status-heading p { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.62 }
.status-content { width: min(calc(100% - 40px),664px); margin: 0 auto; padding-top: 32px; font-size: 14px }
.status-summary,.status-incident,.status-group { border: 1px solid var(--line); background: var(--surface) }
.status-summary { padding: 11px 14px 11px 20px; min-height: 57px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; border-radius: 24px; color: var(--ink-2) }
.status-summary b { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; line-height: 1.5 }
.status-summary b::before { content: ''; width: 10px; height: 10px; flex: none; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb,currentColor 14%,transparent) }
.status-content[data-indicator=none] .status-summary { color: var(--ok); background: color-mix(in srgb,var(--ok) 9%,var(--surface)); border-color: color-mix(in srgb,var(--ok) 30%,var(--surface)) }
.status-content:is([data-indicator=minor],[data-indicator=major],[data-indicator=critical],[data-indicator=maintenance]) .status-summary { color: var(--warn); background: color-mix(in srgb,var(--warn) 15%,var(--surface-2)); border-color: color-mix(in srgb,var(--warn) 30%,var(--surface)) }
.status-actions { display: flex; align-items: center; gap: 12px; font-size: 12px; line-height: 18px; color: var(--muted) }
.status-actions time:not(:empty)::before { content: attr(data-prefix) ' ' }
.status-actions button { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-left: -4px; border: 0; border-radius: 50%; background: transparent; color: var(--action); padding: 0; font: inherit; font-size: 16px; line-height: 1; cursor: pointer }
.status-actions button:hover { background: color-mix(in srgb,var(--action) 10%,transparent) }
.status-actions button:disabled { cursor: progress; opacity: .55 }
.status-incident,.status-group { margin-top: 20px; border-radius: 16px; overflow: hidden }
.status-incident { padding: 16px 20px; background: color-mix(in srgb,var(--warn) 6%,var(--surface)); border-color: color-mix(in srgb,var(--warn) 25%,var(--surface)) }
.status-incident h2 { display: flex; align-items: flex-start; gap: 8px; font-size: 14.4px; line-height: 1.5; font-weight: 600 }
.status-incident h2::before { content: '⚠' / ''; flex: none; color: var(--warn); font-size: 15px; line-height: 21px }
.status-incident small { margin-left: auto }
.status-group h2 { display: flex; align-items: center; justify-content: space-between; gap: 10px }
.status-incident small,.status-group strong { border-radius: 999px; padding: 2px 8px; font-size: 12px; line-height: 18px; font-weight: 600; white-space: nowrap; color: var(--warn); background: color-mix(in srgb,var(--warn) 14%,var(--surface)) }
.status-incident small { font-size: 11.2px; line-height: 16.8px; padding: 2px 6px }
.status-incident p { margin: 7px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.6 }
.status-incident time { display: block; margin: 4px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.6 }
.status-group { border-radius: 24px; box-shadow: 0 1px 2px #17191d0d,0 4px 12px -6px #17191d14 }
.status-group h2 { padding: 15px 20px 14px; font-size: 13px; line-height: 18px; letter-spacing: .06em; text-transform: uppercase; background: var(--st-chip); color: var(--muted) }
.status-group h2 span { font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none }
.status-group ul { padding: 0; list-style: none }
.status-group li { min-height: 48px; padding: 12px 20px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px }
.status-group li span { font-weight: 500; color: var(--ink) }
.status-group strong { display: inline-flex; align-items: center; gap: 6px; padding: 2.5px 8px }
.status-group strong::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor }
.status-group strong[data-state=operational] { color: var(--ok); background: color-mix(in srgb,var(--ok) 12%,var(--surface)) }
@media (prefers-reduced-motion: no-preference) {
  .status-content:not([data-indicator=none]) .status-summary b::before { animation: status-pulse 1.8s ease-in-out infinite }
  @keyframes status-pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb,currentColor 6%,transparent) } }
}
@media(max-width: 620px) {
  .check-tool { padding-top: 27px; min-height: 86vh }
  .check-tool header { margin: 24px 0 28px }
  .check-tool h1 { font-size: 36px }
  .check-steps { padding: 20px 16px 20px }
  .check-steps ol { width: 100%; margin: 12px 0 28px }
  .check-steps li { margin-top: 12px; row-gap: 8px }
  .check-steps li::before { margin-right: calc(100% - 18px) }
  .check-url { min-height: 36px }
  .status-heading { padding-top: 13px }
  .status-summary { padding: 15px 14px 13px 20px; row-gap: 10px }
  .status-actions { min-width: 100% }
}

/* /check: hero verdict tones, checking view, result card, demo */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .service-tool { --st-err: #ff8a80 } }
:root[data-theme="dark"] .service-tool { --st-err: #ff8a80 }
.check-tool h1[data-tone=ok] { color: var(--action) }
.check-tool h1[data-tone=warn] { color: var(--warn) }
.check-tool h1[data-tone=err] { color: var(--st-err) }
.check-tool h1[data-tone] { font-size: clamp(32px,3.45vw,49.6px); line-height: 1.15 }
.check-tool h1[data-tone] + p { max-width: 480px; font-size: 14px; color: var(--ink-2) }
.check-card { position: relative }
.check-progress { position: absolute; left: 0; right: 0; top: 44px; height: 2px; overflow: hidden; opacity: 0 }
.check-card[data-busy] .check-progress { opacity: 1 }
.check-progress::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 40%; background: var(--action); animation: check-load 1s ease-in-out infinite }
.check-bar [data-state=checking] { color: var(--action); font-weight: 600 }
.check-demo-link { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 2px 4px; color: var(--action); font: inherit; font-weight: 600; cursor: pointer }
.check-demo-link:hover { text-decoration: underline; text-underline-offset: 3px }
.check-busy { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 240px; padding: 24px 20px }
.check-busy-meta { display: grid; gap: 2px; text-align: start }
.check-busy-meta small { font-size: 12px; color: var(--muted) }
.check-busy-meta strong,.check-result-email { font: 600 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); overflow-wrap: anywhere }
.check-avatar { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--action); color: var(--action-ink); font-size: 12px; font-weight: 700; letter-spacing: .02em }
.check-avatar--lg { width: 44px; height: 44px; font-size: 15px }
.check-spinner { width: 18px; height: 18px; border: 2px solid var(--st-chip); border-top-color: var(--action); border-radius: 50%; animation: check-spin .8s linear infinite }
.check-result { outline: none }
.check-result-card { padding: 16px 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 1px 2px #17191d0d,0 4px 12px -6px #17191d14 }
.check-result-head { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line) }
.check-result-email { flex: 1; min-width: 0 }
.check-result-time { flex: none; font-size: 12px; color: var(--muted) }
.check-rows { margin: 0 }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 42px; font-size: 13.5px; line-height: 20px }
.check-row dt { display: inline-flex; align-items: center; gap: 8px; flex: none; font-weight: 500; color: var(--muted) }
.check-row dd { margin: 0; font-weight: 600; color: var(--ink); text-align: end }
.check-row svg { color: var(--muted) }
.check-row[data-tone=ok] svg { color: var(--action) }
.check-row[data-tone=warn] svg,.check-row[data-tone=warn] dd.is-strong { color: var(--warn) }
.check-row[data-tone=err] svg,.check-row[data-tone=err] dd.is-strong { color: var(--st-err) }
.check-row--conclusion { min-height: 0; margin-top: 8px; padding: 14px 0 11px; border-top: 1px solid var(--line) }
.check-row--conclusion dt,.check-row--conclusion dd { font-weight: 700 }
.check-row--conclusion[data-tone=ok] :is(dt,dd,svg) { color: var(--action) }
.check-row--conclusion[data-tone=warn] :is(dt,dd,svg) { color: var(--warn) }
.check-row--conclusion[data-tone=err] :is(dt,dd,svg) { color: var(--st-err) }
.check-result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 20px }
.check-secondary,.check-primary { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 22px; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer }
.check-secondary { border: 1px solid color-mix(in srgb,var(--line) 70%,var(--muted)); background: var(--surface); color: var(--ink) }
.check-secondary:hover { border-color: color-mix(in srgb,var(--action) 45%,var(--line)) }
.service-tool a.check-primary { background: var(--action); color: var(--action-ink); box-shadow: 0 4px 14px -4px color-mix(in srgb,var(--action) 55%,transparent) }
.service-tool a.check-primary:hover { background: var(--action-hover); text-decoration: none }
.service-tool .check-refresh-note { margin-top: 16px; font-size: 12.5px; line-height: 20px; color: var(--muted); text-align: center }
.check-refresh-note svg { display: inline-block; vertical-align: -3px }
.check-refresh-note > svg { margin-right: 6px; color: var(--action) }
.check-refresh-note > span { margin-right: 6px }
.check-demo { width: min(780px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 24px; border: 0; border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px -20px #0b122266; overflow: auto }
.check-demo::backdrop { background: #0b1222a6 }
.check-demo-head { display: flex; justify-content: space-between; gap: 16px }
.check-demo-head h2 { font-size: 18px; line-height: 1.4 }
.check-demo-head p { margin-top: 2px; font-size: 13px; color: var(--muted) }
.check-demo-close { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); cursor: pointer }
.check-demo-stage { margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); min-height: 404px }
.demo-scene[hidden] { display: none }
.demo-scene { animation: check-fade .35s ease }
.demo-browser { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface) }
.demo-url { display: flex; align-items: center; gap: 5px; padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--st-chip); font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink-2) }
.demo-url i { width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb,var(--muted) 45%,transparent) }
.demo-url span { margin-left: 8px }
.demo-page { display: grid; justify-items: center; align-content: start; gap: 10px; min-height: 320px; padding: 18px; text-align: center }
.demo-hint { justify-self: start; font-size: 12px; color: var(--ink-2) }
.demo-json { justify-self: stretch; margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--st-chip); color: var(--ink); font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: start; white-space: pre-wrap; overflow-wrap: anywhere; transition: background-color .3s }
.demo-scene[data-progress=late] .demo-json { background: color-mix(in srgb,var(--action) 18%,var(--surface)) }
.demo-badge,.demo-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ink-2) }
.demo-scene[data-progress=late] .demo-badge { border-color: var(--action); color: var(--action) }
.demo-h1 { font-size: 26px; font-weight: 700; line-height: 1.2 }
.demo-h1.is-ok { color: var(--action) }
.demo-lead { max-width: 380px; font-size: 12px; line-height: 1.6; color: var(--ink-2) }
.demo-card,.demo-result { width: min(100%, 300px); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: start; overflow: hidden }
.demo-card-bar { display: flex; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--muted) }
.demo-card-bar .is-accent { color: var(--action); font-weight: 600 }
.demo-empty { display: grid; justify-items: center; gap: 10px; padding: 18px 12px }
.demo-empty b { font-size: 13px }
.demo-pill { border-color: transparent; background: var(--action); color: var(--action-ink) }
.demo-pill.is-outline { border-color: var(--line); background: var(--surface); color: var(--ink) }
.demo-scene[data-progress=late] .demo-empty .demo-pill { box-shadow: 0 0 0 4px color-mix(in srgb,var(--action) 22%,transparent) }
.demo-progress { display: block; height: 2px; background: linear-gradient(90deg,var(--action) 40%,transparent 40%); background-size: 250% 100%; animation: check-load-bg 1s linear infinite }
.demo-account { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px 12px }
.demo-account span:last-child { display: grid; font-size: 12px }
.demo-account small { color: var(--muted) }
.demo-result { padding: 4px 12px 8px }
.demo-result-head { display: flex; align-items: center; gap: 8px; padding: 6px 0 8px; border-bottom: 1px solid var(--line); font: 600 12px ui-monospace, SFMono-Regular, Menlo, monospace }
.demo-kv { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 11px; color: var(--muted) }
.demo-kv b { color: var(--ink) }
.demo-kv.is-ok { border-top: 1px solid var(--line); color: var(--action) }
.demo-kv.is-ok b { color: var(--action) }
.demo-actions { display: flex; gap: 8px }
.service-tool .check-demo-caption { margin-top: 14px; min-height: 22px; font-size: 14px; color: var(--ink) }
.check-demo-track { display: flex; align-items: flex-start; gap: 14px; margin-top: 12px }
.check-demo-play { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--ink); color: var(--surface); cursor: pointer }
.check-demo-track ol { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; flex: 1; margin: 0; padding: 0; list-style: none }
.check-demo-track li button { display: grid; gap: 6px; width: 100%; padding: 4px 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; text-align: start; cursor: pointer }
.check-demo-track li button[aria-current] { color: var(--ink); font-weight: 600 }
.check-demo-track i { display: block; height: 3px; border-radius: 3px; background: var(--st-chip); overflow: hidden }
.check-demo-track b { display: block; height: 100%; background: var(--action); transform: scaleX(0); transform-origin: left }
@keyframes check-load { from { transform: translateX(-100%) } to { transform: translateX(260%) } }
@keyframes check-load-bg { from { background-position: 100% 0 } to { background-position: -150% 0 } }
@keyframes check-spin { to { transform: rotate(360deg) } }
@keyframes check-fade { from { opacity: 0; transform: translateY(4px) } }
@media (prefers-reduced-motion: reduce) { .check-progress::after,.check-spinner,.demo-progress,.demo-scene { animation: none } }
@media (max-width: 620px) {
  .check-tool h1[data-tone] { font-size: 33px }
  .check-tool.is-result header p { text-wrap: wrap }
  .check-result-card { padding: 16px 20px }
  .check-result-head { flex-wrap: wrap; row-gap: 12px }
  .check-result-time { width: 100% }
  .check-row { display: grid; justify-items: start; gap: 4px; padding: 10px 0; min-height: 0 }
  .check-row dd { text-align: start }
  .check-demo { padding: 16px }
  .check-demo-stage { padding: 10px; min-height: 0 }
  .demo-page { min-height: 0; padding: 12px }
  .check-demo-track { gap: 10px }
  .check-demo-track li span { font-size: 11px }
}
.check-tool.is-result { padding-top: calc(clamp(65px,13vh,141px) - 51px) }
.check-tool.is-result header { margin: 14px 0 22px }
.check-tool.is-result header p { margin-top: 10px; text-wrap: balance }
@media (max-width: 620px) { .check-tool.is-result { padding-top: 22px } }
.check-tool header p { word-break: keep-all; text-wrap: balance }
