.as-code-panel { max-width: 820px; padding: 28px !important; border: 1px solid #dce4ed; border-radius: 14px; background: #fff; box-sizing: border-box; }
.as-code-panel h2 { color: #253e58 !important; background: transparent !important; padding: 0 !important; margin-bottom: 20px !important; }
.as-code-panel form { display: grid; gap: 12px; }
.as-code-panel form > p { display: grid; gap: 7px; margin: 0 0 8px; }
.as-code-panel input:not([type=checkbox]), .as-code-panel select { min-height: 40px; max-width: 100%; border-radius: 8px; border: 1px solid #cdd9e6; padding: 8px 12px; box-sizing: border-box; color: #30465e; }
.as-code-panel .helptext { color: #8190a1; font-size: 12px; }
.as-code-panel button { width: fit-content; padding: 11px 22px; border-radius: 8px; }
.as-generated-code { display: block; width: 100%; font-family: ui-monospace, monospace; font-size: 16px; letter-spacing: .6px; margin: 12px 0 20px; background: #f1f6fe; }
.as-code-warning { color: #936720; padding: 13px 16px; border-radius: 8px; background: #fff7e9; line-height: 1.7; }
#changelist .results { overflow: auto; max-width: 100%; max-height: clamp(280px, calc(100vh - 320px), 700px); }
#changelist .paginator { position: static; border-top: 1px solid #e1e7ee; background: #fff; padding: 16px; }
#changelist .field-prefix { white-space: nowrap; }
.as-sidebar .sidebar-nav { max-height: calc(100vh - 155px); overflow-y: auto; overscroll-behavior: contain; }
.as-sidebar .sidebar-link { color: #afc0cc; }
.as-sidebar .sidebar-link:hover, .as-sidebar .sidebar-link.is-active { color: #fff; }
.site-component-membership { padding: 26px; background: #f8fbff; border: 1px solid #dae4ee; border-radius: 14px; margin: 25px 0; }
.site-component-membership h2 { margin: 4px 0; }
.site-member-plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.site-member-plans article { border: 1px solid #d8e3ed; border-radius: 12px; padding: 20px; display: grid; gap: 12px; background: white; color: #46617e; }
.site-member-plans article strong { font-size: 32px; color: #234b76; letter-spacing: -.6px; }
.site-member-plans small { font-size: 12px; color: #778ea6; }
.site-redeem { display: grid; gap: 8px; border-top: 1px solid #dbe5ee; padding-top: 20px; }
.site-redeem > div { display: flex; gap: 10px; }
.site-redeem input { flex: 1; min-width: 0; border: 1px solid #cdd9e6; border-radius: 8px; padding: 11px 13px; background: white; }
.membership-message { padding: 13px 17px; border-radius: 8px; background: #e9f6ee; color: #226a48; }
.membership-message.error { background: #fff0ed; color: #b4443d; }
.account-site-tabs { display: flex; gap: 6px; margin: 8px 0 22px; padding: 5px; border-radius: 13px; background: #edf3f5; }
.account-site-tabs button { flex: 1; border: 0; border-radius: 9px; padding: 11px 8px; background: transparent; color: #607387; cursor: pointer; font-weight: 650; }
.account-site-tabs button.is-active { background: #fff; color: #185d72; box-shadow: 0 1px 4px #19375b1a; }
.account-site-panel[hidden] { display: none; }
@media(max-width: 600px) {
  .site-component-membership { padding: 18px; }
  .site-redeem > div { flex-direction: column; }
  .as-code-panel { padding: 20px !important; }
  .as-generated-code { font-size: 12px; letter-spacing: 0; }
  .account-site-tabs button { font-size: 12px; }
}
@media(max-width: 700px) {
  /* Django's #container > .main outranks the existing #main breakpoint. */
  #container > #main { display: block; }
  .as-sidebar { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
  .as-sidebar .sidebar-nav { min-width: 0; max-width: 100%; }
  #changelist { min-width: 0; }
}
