.auth-page { max-width: 780px; margin: 24px auto; }
.auth-page h1 { margin: 0 0 6px; font-size: 24px; }
.auth-page h2 { font-size: 18px; }
.auth-page p { overflow-wrap: anywhere; }
.auth-field { margin: 18px 0; }
.auth-description { margin: 0; color: var(--muted); }
.auth-note { color: var(--muted); font-size: 13px; }
.auth-page [data-error="true"] { color: #b72d40; }
#authResult { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfd; }
#dmxQrCanvas { display: block; width: 232px; max-width: 100%; height: auto; background: #fff; image-rendering: pixelated; }
.auth-qr-warning { color: #b72d40; font-size: 13px; }
#pluginStatus:empty, #authStatus:empty, #dmxQrError:empty { display: none; }
.auth-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.auth-choice { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-content: center; align-items: center; gap: 6px 12px; width: 100%; min-height: 116px; padding: 14px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 6px #18243306; text-align: left; overflow-wrap: anywhere; }
.auth-choice:hover:not(:disabled), .auth-choice[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-light); }
.auth-choice:disabled { cursor: default; }
.auth-choice-icon { position: relative; grid-column: 1; grid-row: 1 / 4; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--blue); }
.auth-choice-icon svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.auth-choice-name { grid-column: 2; grid-row: 1; font-size: 13px; }
.auth-choice-inn { grid-column: 2; grid-row: 2; }
.auth-choice-expiry { grid-column: 2; grid-row: 3; }
.auth-choice-inn, .auth-choice-expiry { color: var(--muted); font-size: 12px; }
.auth-choice[aria-busy="true"] .auth-choice-icon { background: transparent; }
.auth-choice[aria-busy="true"] .auth-choice-icon svg { visibility: hidden; }
.auth-choice[aria-busy="true"] .auth-choice-icon::after { content: ''; position: absolute; width: 24px; height: 24px; border: 2px solid #d5e3f5; border-top-color: var(--blue); border-radius: 50%; animation: auth-spin .8s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .auth-choice[aria-busy="true"] .auth-choice-icon::after { animation: none; } }
.auth-result-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.auth-result-bar h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 16px; color: var(--ink); }
.auth-result-bar h2::before { content: ''; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: #187344; }
#tokenHiddenLabel, #authExpiry { font-size: 12px; color: var(--muted); }
#tokenHiddenLabel { margin-right: 8px; }
#authExpanded { min-width: 0; }
#authResult .auth-token-area { display: none; }
#authResult[data-expanded="true"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: center; }
#authResult[data-expanded="true"] .auth-result-bar { flex-direction: column; align-items: flex-start; gap: 14px; }
#authResult[data-expanded="true"] .auth-token-area { display: block; width: 100%; }
.auth-token-area > button { width: 100%; }
.auth-qr-area { display: flex; flex-direction: column; align-items: center; text-align: center; }
.auth-qr-area h3 { margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 500; }
#dmxQrPanel { padding: 4px; background: #fff; border-radius: 8px; max-width: 100%; }
.auth-copy-buffer { position: fixed; left: -10000px; top: 0; width: 1px; height: 1px; }
.auth-result-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.auth-token-area p { margin: 8px 0; }
.auth-technical { margin-top: 20px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; color: var(--muted); }
.auth-technical > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; color: var(--ink); font-weight: 600; cursor: pointer; list-style: none; }
.auth-technical > summary::-webkit-details-marker { display: none; }
.auth-technical > summary::after { content: ''; width: 7px; height: 7px; margin-right: 3px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); }
.auth-technical[open] > summary::after { transform: rotate(225deg); }
.auth-help-body { padding: 0 16px 16px; }
.auth-access-note { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 7px; background: var(--blue-light); }
.auth-access-note svg { flex-shrink: 0; width: 20px; height: 20px; fill: none; stroke: var(--blue); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.auth-technical .auth-qr-warning { margin: 0; color: var(--ink); }
.auth-help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 18px; }
.auth-technical h2 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.auth-help-body p { margin: 0 0 8px; line-height: 1.6; }
.auth-help-body p:last-child { margin-bottom: 0; }
.auth-help-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.auth-help-actions button { flex-shrink: 0; }
.auth-help-status { font-size: 12px; }
.auth-help-status p:not(:empty) { margin-top: 10px; }
@media (max-width: 600px) { .auth-help-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; } .auth-help-actions { align-items: flex-start; flex-direction: column; gap: 10px; } }
#authNotice { color: #b72d40; font-size: 13px; }
@media (max-width: 600px) {
  #authResult[data-expanded="true"] { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
  #authResult[data-expanded="true"] .auth-result-bar { display: contents; }
  #authResult[data-expanded="true"] .auth-result-summary { order: 1; }
  #authResult[data-expanded="true"] #authExpanded { order: 2; }
  #authResult[data-expanded="true"] .auth-token-area { order: 3; }
  #authResult[data-expanded="true"] .auth-result-controls { order: 4; justify-content: center; }
  #dmxQrCanvas { margin-inline: auto; }
  .auth-result-bar { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 480px) { .auth-choices { grid-template-columns: minmax(0, 1fr); } }
#chosenOrganisation:empty { display: none; }
