* { box-sizing: border-box }
body { margin: 0; background: #f5f7fa; color: #24354a; font: 1rem/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif }
.wrap { width: min(100% - 28px, 960px); margin-inline: auto }
header { background: white; border-bottom: 3px solid #df6436 }
.brand { display: flex; align-items: center; gap: 12px; height: 78px; font-size: 19px; font-weight: 800; letter-spacing: 1px; color: #173e70 }
.brand img { width: 62px; height: 62px; object-fit: contain }
h1,h2 { color: #173e70; line-height: 1.2 }
h1 { font-size: clamp(1.6rem,4vw,2.15rem); letter-spacing: -.035em; margin: 28px 0 20px }
#groups { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 16px; padding-bottom: 40px }
section { background: white; border: 1px solid #dce4ed; border-radius: 12px; overflow: hidden }
section h2,.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px }
section h2 { margin: 0; padding: 18px; background: #eef3f8; font-size: 1.17rem }
small { font-size: .8rem; font-weight: 500; color: #52677e }
ul { list-style: none; margin: 0; padding: 0 }
li { padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid #e0e7ef; font-weight: 600 }
button { border: 0; border-radius: 7px; background: #173e70; color: white; font: inherit; font-weight: 650; padding: 9px 15px; cursor: pointer }
button:hover { background: #24578f }
button:focus-visible { outline: 3px solid #df6436; outline-offset: 2px }
dialog { width: min(94vw,860px); padding: 0; border: 0; border-radius: 12px }
dialog::backdrop { background: #08131fdc }
.bar { padding: 12px 16px }
.bar h2 { font-size: 1.05rem; margin: 0 }
.close { font-size: 1.45rem; line-height: 1; padding: 8px 12px }
video { display: block; width: 100%; max-height: 72vh; background: black }
#error { padding: 0 16px }
@media(max-width: 650px) { #groups { grid-template-columns: 1fr } }

/* Scale the desktop library with both available width and height. */
html { font-size: clamp(16px, min(1.45vw, 2.7svh), 48px) }
.wrap { width: min(94%, 66rem) }
.brand { height: 4rem; font-size: 1.15rem; gap: .75rem }
.brand img { width: 3.3rem; height: 3.3rem }
h1 { font-size: 2rem; margin: .7rem 0 }
#groups { gap: 1rem; padding-bottom: .7rem }
section h2 { padding: .8rem 1rem }
li { padding: .45rem 1rem }
button { padding: .45rem .85rem }
dialog { width: min(94vw, 64rem) }

@media (max-width:650px) {
  .wrap { width: calc(100% - 1.25rem) }
  .brand { height: clamp(2.3rem, 7svh, 4rem) }
  .brand img { height: 90%; width: auto }
  h1 { font-size: 1.5rem; margin: .4rem 0 }
  #groups { gap: .5rem; padding-bottom: .3rem }
  section h2 { font-size: 1.05rem; padding: .32rem .65rem }
  li { padding: 0 .65rem; min-height: clamp(2.2rem, 6.5svh, 3.4rem) }
  li button { align-self: stretch; margin-block: 2px; padding: .15rem .7rem }
}
@media (orientation:landscape) and (max-height:530px) {
  #groups { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .5rem }
  .brand { height: 2rem }
  .brand img { height: 100%; width: auto }
  h1 { font-size: 1.35rem; margin: .2rem 0 }
  section h2 { font-size: 1rem; padding: .2rem .55rem }
  li { padding: 0 .55rem; min-height: 1.85rem }
  li button { padding: .1rem .55rem; margin-block: 1px }
}
