:root {
  color-scheme: light;
  font: 100%/1.5 "Inter", system-ui, sans-serif;
  color: #17283a;
  background: #f2f5f8;
  --page-gutter: clamp(.625rem, 1vw, 1rem);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.brand { background: #102d40; color: white; padding: 1rem var(--page-gutter); font-weight: 750; }
.brand, .account { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.brand { justify-content: space-between; }
.account { overflow-wrap: anywhere; }
.login { max-width: 29rem; margin-inline: auto; }
.login h1 { font-size: clamp(1.65rem, 5vw, 2.25rem); }
.login form, .login label { display: grid; gap: .4rem; }
.login form { gap: 1rem; margin-top: 1.25rem; }
#login-status:empty { margin: 0; }
main { margin: 1.25rem var(--page-gutter) 2.5rem; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.15; }
h2 { margin: 0; font-size: 1.2rem; }
.workspace { display: grid; grid-template-columns: minmax(8rem, 11rem) repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.page-list { list-style: none; margin: .5rem 0 0; padding: .2rem; display: grid; gap: .2rem; max-height: 28rem; overflow: auto; }
.page-list button { display: flex; align-items: center; gap: .5rem; width: 100%; min-height: 1.85rem; padding: .2rem .45rem; font-size: .875rem; text-align: left; overflow-wrap: anywhere; }
.page-list button.recognized::after { content: ""; flex: 0 0 .5rem; height: .5rem; border-radius: 50%; background: #167644; }
.page-list button[aria-current="true"] { border-color: #005e58; background: #e1f2ef; }
.page-list button:focus-visible { outline-offset: -2px; }
.login input, textarea { padding: .5rem; border: 1px solid #778998; border-radius: .4rem; }
.recognition { align-self: stretch; display: flex; flex-direction: column; }
.recognition #result { flex: 1; display: flex; flex-direction: column; margin-top: 1rem; }
.recognition textarea { flex: 1; display: block; width: 100%; min-height: 13rem; font: inherit; resize: none; overflow: auto; }
.panel { padding: 1.25rem; background: white; border: 1px solid #d2dce4; border-radius: .85rem; }
.controls { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .65rem; margin-bottom: .85rem; padding: .4rem .65rem; }
.recognition-progress { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; margin-bottom: .85rem; font-size: .875rem; }
.recognition-progress progress { flex: 1 1 12rem; height: .85rem; accent-color: #005e58; }
.controls button { padding-block: .3rem; min-height: 2.25rem; }
#cameras { width: 100%; min-width: 0; }
label { font-weight: 650; }
select, input { font: inherit; max-width: 100%; }
select { padding: .55rem; border: 1px solid #778998; border-radius: .4rem; }
.actions, .preview-header, .preview-footer { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.preview-header, .preview-footer { justify-content: space-between; }
button, .button {
  padding: .55rem .8rem;
  min-height: 2.75rem;
  font: inherit;
  font-weight: 650;
  color: #17283a;
  background: white;
  border: 1px solid #778998;
  border-radius: .4rem;
  cursor: pointer;
  text-decoration: none;
}
.primary { background: #005e58; border-color: #005e58; color: white; }
button:disabled { color: #4d5d6a; background: #e9eef2; border-color: #d2dce4; cursor: default; }
:focus-visible { outline: 3px solid #965200; outline-offset: 3px; }
dialog { padding: 1.25rem; border: 1px solid #778998; border-radius: .85rem; color: inherit; }
dialog::backdrop { background: #102d4099; }
#profile-dialog { width: min(50rem, calc(100% - 2rem)); }
#camera-dialog, #open-dialog, #save-dialog { width: min(26rem, calc(100% - 2rem)); }
.camera-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: .65rem; margin-top: 1rem; }
.camera-fields p { margin: 0; }
#export-status:empty { display: none; }
.profile-details { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .4rem 1rem; }
.profile-details dt { font-weight: 650; }
.profile-details dd { margin: 0; overflow-wrap: anywhere; }
.history { overflow: auto; }
.history table { width: 100%; border-collapse: collapse; }
.history th, .history td { padding: .5rem; border-bottom: 1px solid #d2dce4; text-align: left; }
#status { flex: 1 1 14rem; min-width: 0; margin: 0; font-size: .875rem; }
.viewfinder { display: grid; place-items: center; min-height: 19rem; margin-top: 1rem; background: #e9eff3; border-radius: .5rem; }
#empty { padding: 1rem; text-align: center; }
video, img { display: block; width: 100%; max-height: 65vh; object-fit: contain; }
.preview-footer { margin-top: .75rem; }
.preview-footer p { margin: 0; }
@media (max-width: 52rem) {
  .workspace { grid-template-columns: 1fr; }
  .viewfinder { min-height: 13rem; }
}
