/* Rules of the owner page only, on top of the Heliory design system
   (/owner/ds/css/heliory.css: fonts, tokens, base, hly-* components; #582).
   Tokens only: no literal colour here (TestOwnerPageStylesUseTokens). */

main section {
  background: var(--hly-surface);
  border: 1px solid var(--hly-border);
  border-radius: var(--hly-radius-lg);
  padding: var(--hly-space-4) var(--hly-space-5);
  margin: 0 0 var(--hly-space-4);
}
main section h2 { font-size: var(--hly-size-lg); }
main details > summary { cursor: pointer; font-weight: var(--hly-weight-strong); margin-block: var(--hly-space-2); }
#ops > summary { margin-block: 0 var(--hly-space-4); }
#enroll ol { margin: var(--hly-space-2) 0; padding-left: var(--hly-space-5); display: grid; gap: var(--hly-space-1); }
#enroll-link { margin-block: var(--hly-space-3); }
main section > .hly-hint { margin-block: var(--hly-space-2); }
.inactive { opacity: 0.6; }

#status { min-height: 1.5em; }
#status.error { color: var(--hly-danger); font-weight: var(--hly-weight-strong); }
#status.ok { color: var(--hly-success); font-weight: var(--hly-weight-strong); }
.hly-notice { margin: 0 0 var(--hly-space-3); }

form { display: grid; gap: var(--hly-space-3); }
form label:not(.hly-check) { display: grid; gap: var(--hly-space-1); }
form input:not([type="checkbox"], [type="radio"]), form select { width: 100%; }
fieldset {
  display: grid;
  gap: var(--hly-space-2);
  margin: 0;
  padding: var(--hly-space-3);
  border: 1px solid var(--hly-border);
  border-radius: var(--hly-radius-sm);
}
legend { color: var(--hly-text-muted); font-weight: var(--hly-weight-strong); padding: 0 var(--hly-space-1); }
.hly-check { align-items: center; }
button { justify-self: start; }

#az-details { display: grid; grid-template-columns: max-content 1fr; gap: var(--hly-space-1) var(--hly-space-3); margin: 0 0 var(--hly-space-3); }
#az-details dt { color: var(--hly-text-muted); }
#az-details dd { margin: 0; overflow-wrap: anywhere; }

#passkey-list, #oauth-list { list-style: none; padding: 0; margin: 0 0 var(--hly-space-3); display: grid; gap: var(--hly-space-2); }
#passkey-list li { display: flex; flex-wrap: wrap; gap: var(--hly-space-2); align-items: center; }
#oauth-list ul { list-style: none; padding-left: var(--hly-space-4); margin: var(--hly-space-2) 0 0; display: grid; gap: var(--hly-space-1); }
.revoked { color: var(--hly-text-muted); text-decoration: line-through; }
#suspect-list .quote { color: var(--hly-text-muted); font-size: var(--hly-size-sm); margin: var(--hly-space-1) 0; white-space: pre-wrap; overflow-wrap: anywhere; }

pre { margin: 0; white-space: pre-wrap; word-break: break-all; font-size: var(--hly-size-sm); }

/* Views of the owner session (#589): one panel per view, its title takes the
   focus. The navigation is the design system's (.hly-nav in the header). */
[data-panel] h2:focus-visible { outline: 2px solid var(--hly-focus); outline-offset: 2px; }
[data-panel] h2:focus:not(:focus-visible) { outline: none; }

/* The cards of the views still made by hand (To review, History, Connections):
   one fact per card (design system .hly-item), the badge of its source and
   its dated source on one line, wrapping at 320 px. Your memory is the design
   system's alone (#741). */
.facts { display: grid; gap: var(--hly-space-3); margin: var(--hly-space-3) 0; }
.fact p { margin: 0; }
.fact-key code { font-size: var(--hly-size-sm); color: var(--hly-text-muted); overflow-wrap: anywhere; }
.fact-value { font-size: var(--hly-size-lg); overflow-wrap: anywhere; white-space: pre-wrap; }
.fact-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--hly-space-1) var(--hly-space-2); }
.fact--closed .fact-value { color: var(--hly-text-muted); }
.fact button { min-height: 2.75rem; margin-top: var(--hly-space-2); }
.fact button { align-self: flex-start; }

/* To review: a contested fact shows its current value, then each proposal
   on its own block with one button per decision; the decision is replaced by
   what happened (#589). History: one change per card, its items below. */
.proposal { border-top: 1px solid var(--hly-border); margin-top: var(--hly-space-3); padding-top: var(--hly-space-3); display: grid; gap: var(--hly-space-1); }
.proposal .hly-row { flex-wrap: wrap; }
.proposal button, #reauth button { min-height: 2.75rem; }
.review-done { font-weight: var(--hly-weight-strong); }
.history-items { list-style: none; padding: 0; margin: var(--hly-space-2) 0 0; display: grid; gap: var(--hly-space-2); overflow-wrap: anywhere; }
.history-items code { font-size: var(--hly-size-sm); }
#history-more { min-height: 2.75rem; }
#reauth { margin-block: var(--hly-space-2); }

/* Connections: one application or channel token per card, the connections
   of an application below it; what a revocation did replaces its button. */
#token-list { list-style: none; padding: 0; }
.connection p { margin: 0; }
.connection-grants li { display: grid; gap: var(--hly-space-1); }
.connection button { min-height: 2.75rem; margin-top: var(--hly-space-2); }

@media (prefers-reduced-motion: reduce) {
  .fact button, .proposal button, .connection button { transition: none; }
}
